#
# This file is part of veraPDF Validation Model API, a module of the veraPDF project.
# Copyright (c) 2015-2024, veraPDF Consortium <info@verapdf.org>
# All rights reserved.
#
# veraPDF Validation Model API is free software: you can redistribute it and/or modify
# it under the terms of either:
#
# The GNU General public license GPLv3+.
# You should have received a copy of the GNU General Public License
# along with veraPDF Validation Model API as the LICENSE.GPL file in the root of the source
# tree.  If not, see http://www.gnu.org/licenses/ or
# https://www.gnu.org/licenses/gpl-3.0.en.html.
#
# The Mozilla Public License MPLv2+.
# You should have received a copy of the Mozilla Public License along with
# veraPDF Validation Model API as the LICENSE.MPL file in the root of the source tree.
# If a copy of the MPL was not distributed with this file, you can obtain one at
# http://mozilla.org/MPL/2.0/.
#

name: PR QA

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:
    name: Checkout and Build
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        java-version: [ 11, 17, 21 ]

    steps:
      - uses: actions/checkout@v4
      - name: JDK setup
        uses: actions/setup-java@v4
        continue-on-error: true
        with:
          java-version: ${{ matrix.java-version }}
          distribution: 'temurin'
          cache: maven
      - name: Build with Maven
        run: mvn --batch-mode --update-snapshots verify
#
# This file is part of veraPDF Validation Model API, a module of the veraPDF project.
# Copyright (c) 2015-2024, veraPDF Consortium <info@verapdf.org>
# All rights reserved.
#
# veraPDF Validation Model API is free software: you can redistribute it and/or modify
# it under the terms of either:
#
# The GNU General public license GPLv3+.
# You should have received a copy of the GNU General Public License
# along with veraPDF Validation Model API as the LICENSE.GPL file in the root of the source
# tree.  If not, see http://www.gnu.org/licenses/ or
# https://www.gnu.org/licenses/gpl-3.0.en.html.
#
# The Mozilla Public License MPLv2+.
# You should have received a copy of the Mozilla Public License along with
# veraPDF Validation Model API as the LICENSE.MPL file in the root of the source tree.
# If a copy of the MPL was not distributed with this file, you can obtain one at
# http://mozilla.org/MPL/2.0/.
#

name: Update arlington branch

on:
  push:
    branches:
      - integration

jobs:
  checkout-and-build:
    if: github.repository == 'veraPDF/veraPDF-model'
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        java-version: [11, 17, 21]

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: integration
      - name: JDK setup
        uses: actions/setup-java@v4
        continue-on-error: true
        with:
          java-version: ${{ matrix.java-version }}
          distribution: 'temurin'
          cache: maven
      - name: Fetch arlington branch and checkout
        run: |
          git fetch origin arlington:arlington
          git checkout -b test-branch arlington
      - name: Configure user name
        run: |
          git config user.name "Git User"
          git config user.email "user@test.com"
      - name: Add commit to the test branch
        run: git cherry-pick -m 1 ${{ github.event.before }}..${{ github.event.after }} --empty=drop
      - name: Build project with Maven
        if: success()
        run: mvn --batch-mode --update-snapshots verify

  merge:
    runs-on: ubuntu-latest
    needs: checkout-and-build
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: integration
      - name: Generate new branch name
        id: new-branch-name
        run: echo "branch_name=new-branch-$(date +%s)" >> "$GITHUB_OUTPUT"
      - name: Fetch arlington branch and checkout
        run: |
          git fetch origin arlington:arlington
          git checkout -b ${{ steps.new-branch-name.outputs.branch_name }} arlington
      - name: Configure user name
        run: |
          git config user.name "Git User"
          git config user.email "user@temp.com"
      - name: Add commit to new branch
        run: git cherry-pick -m 1 ${{ github.event.before }}..${{ github.event.after }} --empty=drop
      - name: Merge branch into arlington
        if: success()
        run: |
          git push origin ${{ steps.new-branch-name.outputs.branch_name }}
          git checkout arlington
          git merge ${{ steps.new-branch-name.outputs.branch_name }}
          git push origin arlington
      - name: Delete new branch
        run: git push origin --delete ${{ steps.new-branch-name.outputs.branch_name }}

  send-notification:
    runs-on: ubuntu-latest
    needs: [checkout-and-build, merge]
    if: |
      always() &&
      github.repository == 'veraPDF/veraPDF-model' &&      
      (contains(needs.*.result, 'failure') ||
      contains(needs.*.result, 'skipped') ||
      contains(needs.*.result, 'cancelled'))
    steps:
      - name: Send notification if build or merge failed
        env:
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
        uses: voxmedia/github-action-slack-notify-build@v1
        with:
          channel_id: C03E3JJGLQL
          status: FAILED
          color: danger
**/bin
**/generated-model/
**/target/
.idea/*
*.iml

# Eclipse artefacts
**/.project
**/.settings
**/.classpath

# Maven stuff
/target/
**/pom.xml.versionsBackup
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    {one line to give the program's name and a brief idea of what it does.}
    Copyright (C) {year}  {name of author}

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    {project}  Copyright (C) {year}  {fullname}
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Mozilla Public License, version 2.0

1. Definitions

1.1. "Contributor"

     means each individual or legal entity that creates, contributes to the
     creation of, or owns Covered Software.

1.2. "Contributor Version"

     means the combination of the Contributions of others (if any) used by a
     Contributor and that particular Contributor's Contribution.

1.3. "Contribution"

     means Covered Software of a particular Contributor.

1.4. "Covered Software"

     means Source Code Form to which the initial Contributor has attached the
     notice in Exhibit A, the Executable Form of such Source Code Form, and
     Modifications of such Source Code Form, in each case including portions
     thereof.

1.5. "Incompatible With Secondary Licenses"
     means

     a. that the initial Contributor has attached the notice described in
        Exhibit B to the Covered Software; or

     b. that the Covered Software was made available under the terms of
        version 1.1 or earlier of the License, but not also under the terms of
        a Secondary License.

1.6. "Executable Form"

     means any form of the work other than Source Code Form.

1.7. "Larger Work"

     means a work that combines Covered Software with other material, in a
     separate file or files, that is not Covered Software.

1.8. "License"

     means this document.

1.9. "Licensable"

     means having the right to grant, to the maximum extent possible, whether
     at the time of the initial grant or subsequently, any and all of the
     rights conveyed by this License.

1.10. "Modifications"

     means any of the following:

     a. any file in Source Code Form that results from an addition to,
        deletion from, or modification of the contents of Covered Software; or

     b. any new file in Source Code Form that contains any Covered Software.

1.11. "Patent Claims" of a Contributor

      means any patent claim(s), including without limitation, method,
      process, and apparatus claims, in any patent Licensable by such
      Contributor that would be infringed, but for the grant of the License,
      by the making, using, selling, offering for sale, having made, import,
      or transfer of either its Contributions or its Contributor Version.

1.12. "Secondary License"

      means either the GNU General Public License, Version 2.0, the GNU Lesser
      General Public License, Version 2.1, the GNU Affero General Public
      License, Version 3.0, or any later versions of those licenses.

1.13. "Source Code Form"

      means the form of the work preferred for making modifications.

1.14. "You" (or "Your")

      means an individual or a legal entity exercising rights under this
      License. For legal entities, "You" includes any entity that controls, is
      controlled by, or is under common control with You. For purposes of this
      definition, "control" means (a) the power, direct or indirect, to cause
      the direction or management of such entity, whether by contract or
      otherwise, or (b) ownership of more than fifty percent (50%) of the
      outstanding shares or beneficial ownership of such entity.


2. License Grants and Conditions

2.1. Grants

     Each Contributor hereby grants You a world-wide, royalty-free,
     non-exclusive license:

     a. under intellectual property rights (other than patent or trademark)
        Licensable by such Contributor to use, reproduce, make available,
        modify, display, perform, distribute, and otherwise exploit its
        Contributions, either on an unmodified basis, with Modifications, or
        as part of a Larger Work; and

     b. under Patent Claims of such Contributor to make, use, sell, offer for
        sale, have made, import, and otherwise transfer either its
        Contributions or its Contributor Version.

2.2. Effective Date

     The licenses granted in Section 2.1 with respect to any Contribution
     become effective for each Contribution on the date the Contributor first
     distributes such Contribution.

2.3. Limitations on Grant Scope

     The licenses granted in this Section 2 are the only rights granted under
     this License. No additional rights or licenses will be implied from the
     distribution or licensing of Covered Software under this License.
     Notwithstanding Section 2.1(b) above, no patent license is granted by a
     Contributor:

     a. for any code that a Contributor has removed from Covered Software; or

     b. for infringements caused by: (i) Your and any other third party's
        modifications of Covered Software, or (ii) the combination of its
        Contributions with other software (except as part of its Contributor
        Version); or

     c. under Patent Claims infringed by Covered Software in the absence of
        its Contributions.

     This License does not grant any rights in the trademarks, service marks,
     or logos of any Contributor (except as may be necessary to comply with
     the notice requirements in Section 3.4).

2.4. Subsequent Licenses

     No Contributor makes additional grants as a result of Your choice to
     distribute the Covered Software under a subsequent version of this
     License (see Section 10.2) or under the terms of a Secondary License (if
     permitted under the terms of Section 3.3).

2.5. Representation

     Each Contributor represents that the Contributor believes its
     Contributions are its original creation(s) or it has sufficient rights to
     grant the rights to its Contributions conveyed by this License.

2.6. Fair Use

     This License is not intended to limit any rights You have under
     applicable copyright doctrines of fair use, fair dealing, or other
     equivalents.

2.7. Conditions

     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
     Section 2.1.


3. Responsibilities

3.1. Distribution of Source Form

     All distribution of Covered Software in Source Code Form, including any
     Modifications that You create or to which You contribute, must be under
     the terms of this License. You must inform recipients that the Source
     Code Form of the Covered Software is governed by the terms of this
     License, and how they can obtain a copy of this License. You may not
     attempt to alter or restrict the recipients' rights in the Source Code
     Form.

3.2. Distribution of Executable Form

     If You distribute Covered Software in Executable Form then:

     a. such Covered Software must also be made available in Source Code Form,
        as described in Section 3.1, and You must inform recipients of the
        Executable Form how they can obtain a copy of such Source Code Form by
        reasonable means in a timely manner, at a charge no more than the cost
        of distribution to the recipient; and

     b. You may distribute such Executable Form under the terms of this
        License, or sublicense it under different terms, provided that the
        license for the Executable Form does not attempt to limit or alter the
        recipients' rights in the Source Code Form under this License.

3.3. Distribution of a Larger Work

     You may create and distribute a Larger Work under terms of Your choice,
     provided that You also comply with the requirements of this License for
     the Covered Software. If the Larger Work is a combination of Covered
     Software with a work governed by one or more Secondary Licenses, and the
     Covered Software is not Incompatible With Secondary Licenses, this
     License permits You to additionally distribute such Covered Software
     under the terms of such Secondary License(s), so that the recipient of
     the Larger Work may, at their option, further distribute the Covered
     Software under the terms of either this License or such Secondary
     License(s).

3.4. Notices

     You may not remove or alter the substance of any license notices
     (including copyright notices, patent notices, disclaimers of warranty, or
     limitations of liability) contained within the Source Code Form of the
     Covered Software, except that You may alter any license notices to the
     extent required to remedy known factual inaccuracies.

3.5. Application of Additional Terms

     You may choose to offer, and to charge a fee for, warranty, support,
     indemnity or liability obligations to one or more recipients of Covered
     Software. However, You may do so only on Your own behalf, and not on
     behalf of any Contributor. You must make it absolutely clear that any
     such warranty, support, indemnity, or liability obligation is offered by
     You alone, and You hereby agree to indemnify every Contributor for any
     liability incurred by such Contributor as a result of warranty, support,
     indemnity or liability terms You offer. You may include additional
     disclaimers of warranty and limitations of liability specific to any
     jurisdiction.

4. Inability to Comply Due to Statute or Regulation

   If it is impossible for You to comply with any of the terms of this License
   with respect to some or all of the Covered Software due to statute,
   judicial order, or regulation then You must: (a) comply with the terms of
   this License to the maximum extent possible; and (b) describe the
   limitations and the code they affect. Such description must be placed in a
   text file included with all distributions of the Covered Software under
   this License. Except to the extent prohibited by statute or regulation,
   such description must be sufficiently detailed for a recipient of ordinary
   skill to be able to understand it.

5. Termination

5.1. The rights granted under this License will terminate automatically if You
     fail to comply with any of its terms. However, if You become compliant,
     then the rights granted under this License from a particular Contributor
     are reinstated (a) provisionally, unless and until such Contributor
     explicitly and finally terminates Your grants, and (b) on an ongoing
     basis, if such Contributor fails to notify You of the non-compliance by
     some reasonable means prior to 60 days after You have come back into
     compliance. Moreover, Your grants from a particular Contributor are
     reinstated on an ongoing basis if such Contributor notifies You of the
     non-compliance by some reasonable means, this is the first time You have
     received notice of non-compliance with this License from such
     Contributor, and You become compliant prior to 30 days after Your receipt
     of the notice.

5.2. If You initiate litigation against any entity by asserting a patent
     infringement claim (excluding declaratory judgment actions,
     counter-claims, and cross-claims) alleging that a Contributor Version
     directly or indirectly infringes any patent, then the rights granted to
     You by any and all Contributors for the Covered Software under Section
     2.1 of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
     license agreements (excluding distributors and resellers) which have been
     validly granted by You or Your distributors under this License prior to
     termination shall survive termination.

6. Disclaimer of Warranty

   Covered Software is provided under this License on an "as is" basis,
   without warranty of any kind, either expressed, implied, or statutory,
   including, without limitation, warranties that the Covered Software is free
   of defects, merchantable, fit for a particular purpose or non-infringing.
   The entire risk as to the quality and performance of the Covered Software
   is with You. Should any Covered Software prove defective in any respect,
   You (not any Contributor) assume the cost of any necessary servicing,
   repair, or correction. This disclaimer of warranty constitutes an essential
   part of this License. No use of  any Covered Software is authorized under
   this License except under this disclaimer.

7. Limitation of Liability

   Under no circumstances and under no legal theory, whether tort (including
   negligence), contract, or otherwise, shall any Contributor, or anyone who
   distributes Covered Software as permitted above, be liable to You for any
   direct, indirect, special, incidental, or consequential damages of any
   character including, without limitation, damages for lost profits, loss of
   goodwill, work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses, even if such party shall have been
   informed of the possibility of such damages. This limitation of liability
   shall not apply to liability for death or personal injury resulting from
   such party's negligence to the extent applicable law prohibits such
   limitation. Some jurisdictions do not allow the exclusion or limitation of
   incidental or consequential damages, so this exclusion and limitation may
   not apply to You.

8. Litigation

   Any litigation relating to this License may be brought only in the courts
   of a jurisdiction where the defendant maintains its principal place of
   business and such litigation shall be governed by laws of that
   jurisdiction, without reference to its conflict-of-law provisions. Nothing
   in this Section shall prevent a party's ability to bring cross-claims or
   counter-claims.

9. Miscellaneous

   This License represents the complete agreement concerning the subject
   matter hereof. If any provision of this License is held to be
   unenforceable, such provision shall be reformed only to the extent
   necessary to make it enforceable. Any law or regulation which provides that
   the language of a contract shall be construed against the drafter shall not
   be used to construe this License against a Contributor.


10. Versions of the License

10.1. New Versions

      Mozilla Foundation is the license steward. Except as provided in Section
      10.3, no one other than the license steward has the right to modify or
      publish new versions of this License. Each version will be given a
      distinguishing version number.

10.2. Effect of New Versions

      You may distribute the Covered Software under the terms of the version
      of the License under which You originally received the Covered Software,
      or under the terms of any subsequent version published by the license
      steward.

10.3. Modified Versions

      If you create software not governed by this License, and you want to
      create a new license for such software, you may create and use a
      modified version of this License if you rename the license and remove
      any references to the name of the license steward (except to note that
      such modified license differs from this License).

10.4. Distributing Source Code Form that is Incompatible With Secondary
      Licenses If You choose to distribute Source Code Form that is
      Incompatible With Secondary Licenses under the terms of this version of
      the License, the notice described in Exhibit B of this License must be
      attached.

Exhibit A - Source Code Form License Notice

      This Source Code Form is subject to the
      terms of the Mozilla Public License, v.
      2.0. If a copy of the MPL was not
      distributed with this file, You can
      obtain one at
      http://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular file,
then You may include the notice in a location (such as a LICENSE file in a
relevant directory) where a recipient would be likely to look for such a
notice.

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice

      This Source Code Form is "Incompatible
      With Secondary Licenses", as defined by
      the Mozilla Public License, v. 2.0.

veraPDF-model
=============
The veraPDF Validation model described using a Domain Specific Language developed in [XText](https://eclipse.org/Xtext/).

[![Build Status](https://jenkins.openpreservation.org/job/veraPDF/job/1.27/job/model/badge/icon)](https://jenkins.openpreservation.org/job/veraPDF/job/1.27/job/model/ "OPF Jenkins")
[![Maven Central](https://img.shields.io/maven-central/v/org.verapdf/pdf-model.svg)](https://repo1.maven.org/maven2/org/verapdf/pdf-model/ "Maven central")
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0b6a3e7f350c47d4a1ea1c5b500bbf68)](https://app.codacy.com/gh/veraPDF/veraPDF-model/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade "Codacy grade")

[![GitHub issues](https://img.shields.io/github/issues/veraPDF/veraPDF-library.svg)](https://github.com/veraPDF/veraPDF-library/issues "Open issues on GitHub")
[![GitHub issues](https://img.shields.io/github/issues-closed/veraPDF/veraPDF-library.svg)](https://github.com/veraPDF/veraPDF-library/issues?q=is%3Aissue+is%3Aclosed "Closed issues on GitHub")
[![GitHub issues](https://img.shields.io/github/issues-pr/veraPDF/veraPDF-model.svg)](https://github.com/veraPDF/veraPDF-model/pulls "Open pull requests on GitHub")
[![GitHub issues](https://img.shields.io/github/issues-pr-closed/veraPDF/veraPDF-model.svg)](https://github.com/veraPDF/veraPDF-model/pulls?q=is%3Apr+is%3Aclosed "Closed pull requests on GitHub")

Licensing
---------
The veraPDF Validation model is dual-licensed, see:

 - [GPLv3+](LICENSE.GPL "GNU General Public License, version 3")
 - [MPLv2+](LICENSE.MPL "Mozilla Public License, version 2.0")

Pre-requisites
--------------
In order to generate the model classes you'll need:

 * Java 11, 17 or 21, which can be downloaded [from Oracle](https://www.oracle.com/technetwork/java/javase/downloads/index.html), or for Linux users [OpenJDK](https://openjdk.java.net/install/index.html).
 * [Maven v3+](https://maven.apache.org/)

If you want to edit and regenerate the model you'll need:

 * The [veraPDF-model-syntax project](https://github.com/veraPDF/veraPDF-model-syntax), the [README](https://github.com/veraPDF/veraPDF-model-syntax/blob/master/README.md) gives instructions on how to install and use XText support in Eclipse.

Generating the veraPDF Model
----------------------------
 1. Download the veraPDF-model repository, either: `git clone https://github.com/veraPDF/veraPDF-model`
 or download the [latest tar archive](https://github.com/veraPDF/veraPDF-model/archive/master.tar.gz "veraPDF-Model latest GitHub tar archive") or [zip equivalent](https://github.com/veraPDF/veraPDF-model/archive/master.zip "veraPDF-Model latest GitHub zip archive") from GitHub.
 2. Move to the downloaded project directory, e.g. `cd veraPDF-model`
 3. Build and install using Maven: `mvn clean install`
This file is part of ${project.name}, a module of the veraPDF project.
Copyright (c) ${project.inceptionYear}-${current.year}, ${owner} <${email}>
All rights reserved.

${project.name} is free software: you can redistribute it and/or modify
it under the terms of either:

The GNU General public license GPLv3+.
You should have received a copy of the GNU General Public License
along with ${project.name} as the LICENSE.GPL file in the root of the source
tree.  If not, see http://www.gnu.org/licenses/ or
https://www.gnu.org/licenses/gpl-3.0.en.html.

The Mozilla Public License MPLv2+.
You should have received a copy of the Mozilla Public License along with
${project.name} as the LICENSE.MPL file in the root of the source tree.
If a copy of the MPL was not distributed with this file, you can obtain one at 
http://mozilla.org/MPL/2.0/.
<!--

    This file is part of veraPDF Validation Model API, a module of the veraPDF project.
    Copyright (c) 2015-2024, veraPDF Consortium <info@verapdf.org>
    All rights reserved.

    veraPDF Validation Model API is free software: you can redistribute it and/or modify
    it under the terms of either:

    The GNU General public license GPLv3+.
    You should have received a copy of the GNU General Public License
    along with veraPDF Validation Model API as the LICENSE.GPL file in the root of the source
    tree.  If not, see http://www.gnu.org/licenses/ or
    https://www.gnu.org/licenses/gpl-3.0.en.html.

    The Mozilla Public License MPLv2+.
    You should have received a copy of the Mozilla Public License along with
    veraPDF Validation Model API as the LICENSE.MPL file in the root of the source tree.
    If a copy of the MPL was not distributed with this file, you can obtain one at
    http://mozilla.org/MPL/2.0/.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.verapdf</groupId>
    <artifactId>verapdf-parent</artifactId>
    <version>1.27.2</version>
    <relativePath />
  </parent>

  <groupId>org.verapdf</groupId>
  <artifactId>pdf-model</artifactId>
  <version>1.27.0-SNAPSHOT</version>

  <name>veraPDF Validation Model API</name>
  <description>Java interfaces for the veraPDF Validation model, generated from the Xtext DSL.</description>

  <url>https://github.com/veraPDF/veraPDF-model/</url>
  <inceptionYear>2015</inceptionYear>

  <scm>
    <url>https://github.com/veraPDF/veraPDF-model/</url>
    <connection>scm:git:https://github.com/veraPDF/veraPDF-model.git</connection>
    <developerConnection>scm:git:git@github.com:veraPDF/veraPDF-model.git</developerConnection>
  </scm>

  <repositories>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>vera-dev</id>
      <name>Vera development</name>
      <url>https://artifactory.openpreservation.org/artifactory/vera-dev</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>vera-dev</id>
      <name>Vera development</name>
      <url>https://artifactory.openpreservation.org/artifactory/vera-dev</url>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <verapdf.model.syntax.version>[1.27.0,1.28.0-RC)</verapdf.model.syntax.version>
    <xtext.version>2.26.0</xtext.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <executions>
          <execution>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
            <configuration>
              <filesets>
                <fileset>
                  <directory>generated-model/java/</directory>
                </fileset>
              </filesets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.eclipse.xtext</groupId>
        <artifactId>xtext-maven-plugin</artifactId>
        <version>${xtext.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <languages>
            <language>
              <setup>org.verapdf.ModelStandaloneSetup</setup>
              <outputConfigurations>
                <outputConfiguration>
                  <outputDirectory>generated-model/java/</outputDirectory>
                </outputConfiguration>
              </outputConfigurations>
            </language>
          </languages>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.verapdf</groupId>
            <artifactId>org.verapdf</artifactId>
            <version>${verapdf.model.syntax.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.eclipse.xtend</groupId>
        <artifactId>xtend-maven-plugin</artifactId>
        <version>${xtext.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>xtend-install-debug-info</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
         <inherited>true</inherited>
         <executions>
           <!-- here we override the super-pom attach-sources executionid which
           calls sources:jar goal. That goals forks the lifecycle, causing
           the generate-sources phase to be called twice for the install goal.
           This causes any other plugin bound to the generate-sources phase to
           be called twice which usually has nasty side effects, let alone
           creating duplicate processing and longer build times. -->
           <execution>
             <id>attach-sources</id>
             <phase>DISABLE_FORKED_LIFECYCLE_MSOURCES-13</phase>
           </execution>
           <execution>
             <id>attach-sources-no-fork</id>
             <inherited>true</inherited>
             <goals>
               <goal>jar-no-fork</goal>
             </goals>
           </execution>
         </executions>
        </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>generated-model/java/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>Java 1.8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
      </properties>
    </profile>
  </profiles>

</project>
package org.verapdf.model.baselayer;

% Root object for the complete hierarchy of PDF types
type Object {

}
package org.verapdf.model.coslayer;

import org.verapdf.model.baselayer.Object;
import org.verapdf.model.pdlayer.PDMetadata;
import org.verapdf.model.pdlayer.PDDocument;
import org.verapdf.model.salayer.SAPDFDocument;
import org.verapdf.model.pdlayer.PDEncryption;
import org.verapdf.model.external.EmbeddedFile;

% Parent type for all basic PDF objects
type CosObject extends Object {

}

% Low-level PDF Document object 
type CosDocument extends CosObject {
	% number of indirect objects in the document
	property nrIndirects: Integer;
	% version of the document
	property headerVersion: Decimal;
	% true if the OCProperties key is present in the document Catalog
	property isOptionalContentPresent: Boolean;
	% size of data after the EOF and (optional) end of line marker
	property postEOFDataSize: Integer;
	% id of the first page trailer, if the document is linearized. Null, if the document is not linearized
	property firstPageID: String;
	% id of the last trailer in the document
	property lastID: String;
	% string representation of id of the first page trailer, if the document is linearized. Null, if the document is not linearized
	property firstPageIDValue: String;
	% string representation of id of the last trailer in the document
	property lastIDValue: String;
	% true if the document is linearized
	property isLinearized: Boolean;
	% link to all embedded file specifications
	link EmbeddedFiles: CosFileSpecification*;
	% link to the document cross reference table
	link xref: CosXRef;
	% trailer dictionary (first page trailer for the linearized PDF or the last trailer in the document)
	link trailer: CosTrailer;
	% all indirect objects referred from the xref table
	link indirectObjects: CosIndirect+;
	% offset of the PDF document header
	property headerOffset: Integer;
	% the content of the PDF header
	property header: String;
	% first four bytes in the comment that follows the PDF header
	property headerByte1: Integer;
	property headerByte2: Integer;
	property headerByte3: Integer;
	property headerByte4: Integer;
	% link to the high-level PDF Document structure
	link document: PDDocument;
	% the value of the /Marked entry in the MarkInfo dictionary (false, if this entry is missing)
	property Marked: Boolean;
	% string representation of the value of /Requirements key in the document Catalog:
	% - the space-concatenated values of the /S key in the requirement dictionaries in the array referenced by the /Requirements key
	% - empty string if the array of requirement dictionaries is empty; 
	% - null, if the /Requirements key is not present in the document Catalog 
	property Requirements: String;
	% NeedsRendering entry in the document's Catalog (false by default)
	property NeedsRendering: Boolean;
	% true, if the document contains the EmbeddedFiles entry in the names dictionary
	property containsEmbeddedFiles: Boolean;
	% value of the /Suspects entry in the MarkInfo dictionary
	property Suspects: Boolean;
	% value of the /DisplayDocTitle key in the ViewerPreferences dictionary
	property DisplayDocTitle: Boolean;
	% true if the trailer dictionary contains Info key
	property containsInfo: Boolean;
	% true if the document catalog dictionary contains PieceInfo entry
	property containsPieceInfo: Boolean;
	% string representation of the MarkInfo dictionary
	property MarkInfo: String;
	% string representation of the ViewerPreferences dictionary
	property ViewerPreferences: String;
	% link to Document structure for structure analysis
	link doc: SAPDFDocument?;
}

% PDF Indirect object
type CosIndirect extends CosObject {
	% the direct contents of the indirect object
	link directObject: CosObject;
	% true if the spacings around object number, generation number, keywords 'obj' and 'endobj' comply to PDF/A standard
	property spacingCompliesPDFA: Boolean;
}

% PDF null object	
type CosNull extends CosObject {
	
}

% PDF boolean object
type CosBool extends CosObject {
	% value of this object
	property value: Boolean;
}

% Generic Number type
type CosNumber extends CosObject {
	% the string representing this object
	property stringValue: String;
	% truncated integer value
	property intValue: Integer;
	% original decimal value
	property realValue: Decimal;
}

% PDF Real type	
type CosReal extends CosNumber {

}

% PDF Integer type
type CosInteger extends CosNumber {
	
}

% PDF Name type	
type CosName extends CosObject {
	% Byte sequence representation of the Name object after applying escape mechanism
	property internalRepresentation: String;
}

% blend mode
type CosBM extends CosName {
}

% actual text
type CosActualText extends CosString {
}

% alt
type CosAlt extends CosString {
}


% PDF Name representing a Utf8 string
type CosUnicodeName extends CosName {
	% indicates if the Name represents a Unicode string correctly encoded by Utf8
	property isValidUtf8: Boolean;
	% the Unicode value of the Name object
	property unicodeValue: String;
}


% PDF Name representing rendering intent	
type CosRenderingIntent extends CosName {

}

% PDF Name representing a single stream filter including decode parameters
type CosFilter extends CosName {
	% String representation of the decodeParms dictionary. Possible values are :
	% "Default" : if decodeParms dictionary is not present
	% "Identity" : the value of the Name entry in the Crypt parameters dictionary
	% "Custom" : in all other cases
	property decodeParms: String;
}

% PDF Name representing a single inline image filter
type CosIIFilter extends CosName {

}
	
% PDF String type
type CosString extends CosObject {
	% internal byte presentation of the string after decoding from hex format (for strings in hexadecimal format) or after decoding all escape sequences (for strings in standard format)
	property value: String;
	% true if the string is stored in Hex format
	property isHex: Boolean;
	% true if the all non-white-space characters if the hexadecimal string belong to the range 0-9, a-f, A-F
	property containsOnlyHex: Boolean;
	% for hexadecimal strings the number of Hex digits (non-white-space characters in the range 0-9, a-f, A-F); 0 for strings in standard format
	property hexCount: Integer;
	% true if string value contains codes from Unicode Private Use Area
	property containsPUA: Boolean;	
}

% PDF Text String type
type CosTextString extends CosString {
	% string in unicode
	property unicodeValue: String;
}

% Lang type
type CosLang extends CosTextString {

}

% PDF Dict type
type CosDict extends CosObject {
	% number of key/value pairs in the dictionary
	property size: Integer;
	% all keys of the dictionary
	link keys: CosName*;
	% all values of the dictionary
	link values: CosObject*;
	% XMP metadata if it is present
	link metadata: PDMetadata?;
	% ampersand separated list of all keys of the dictionary
	property keysString: String;
}
	
% PDF Stream type
type CosStream extends CosDict {
	% value of the Length key in the Stream dictionary
	property Length: Integer;
	% real length of stream
	property realLength: Integer;
	% represents value of F key or null if stream does not contain this key
	property F: String;
	% represents value of FFilter key or null if stream does not contain this key
	property FFilter: String;
	% represents value of FDecodeParms key or null if stream does not contain this key
	property FDecodeParms: String;
	% true if spacings around keywords 'stream' comply to the PDF/A standard
	property streamKeywordCRLFCompliant: Boolean;
	% true if spacings around keywords 'endstream' comply to the PDF/A standard
	property endstreamKeywordEOLCompliant: Boolean;
	% link to the stream filters
	link filters: CosFilter*;
}

% File specification dictionary
type CosFileSpecification extends CosDict {
	% link to the embedded file stream
	link EF: EmbeddedFile?;
	% true if the file specification dictionary contains EF key
	property containsEF: Boolean;
	% true if the file specification dictionary contains Desc key
	property containsDesc: Boolean;
	% a file specification string (F key)
	property F: String;
	% a unicode file specification (UF key)
	property UF: String;
	% the relationship between the component of the PDF document that refers to this file specification and the associated file (/AFRelationship key)
	property AFRelationship: String;
	% true if the file specification dictionary is associated (=referenced by the /AF key) with at least one of the following objects: catalog, page, XObject, annotation or structure element
	property isAssociatedFile: Boolean;
	% true if the file specification dictionary is present in the EmbeddedFiles name tree
	property presentInEmbeddedFiles: Boolean;
}
	
% Trailer of the document	
type CosTrailer extends CosDict {
	% true if the document is encrypted
	property isEncrypted: Boolean;
	% link to the Encryption dictionary
	link Encrypt: PDEncryption?;
	% link to the document information dictionary
	link Info: CosInfo?;
}

% Information dictionary
type CosInfo extends CosDict {
	% value of ModDate entry
	property ModDate: String;
	% string representation of XMP Modify Date
	property XMPModifyDate: String;
	% true, if ModDate entry and XMP Modify Date have equivalent values
	property doModDatesMatch: Boolean;

	% value of CreationDate entry
	property CreationDate: String;
	% string representation of XMP Create Date
	property XMPCreateDate: String;
	% true, if CreationDate entry and XMP Create Date have equivalent values
	property doCreationDatesMatch: Boolean;

	% value of Title entry without trailing zero
	property Title: String;
	% value of XMP Title
	property XMPTitle: String;

	% value of Author entry without trailing zero
	property Author: String;
	% comma separated list of XMP Creator array
	property XMPCreator: String;
	% size of XMP Creator array
	property XMPCreatorSize: Integer;

	% value of Subject entry without trailing zero
	property Subject: String;
	% value of XMP Description
	property XMPDescription: String;

	% value of Producer entry without trailing zero
	property Producer: String;
	% value of XMP Producer
	property XMPProducer: String;

	% value of Creator entry without trailing zero
	property Creator: String;
	% value of XMP Creator Tool
	property XMPCreatorTool: String;

	% value of Keywords entry without trailing zero
	property Keywords: String;
	% value of XMP Keywords
	property XMPKeywords: String;
}

% PDF Array type	
type CosArray extends CosObject {
	% number of elements in the array
	property size: Integer;
	% all objects contained in the array
	link elements: CosObject*;
}
	
% Bounding box array
type CosBBox extends CosArray {
	property top: Decimal;
	property bottom: Decimal;
	property left: Decimal;
	property right: Decimal;
}

% Cross reference table of the document
type CosXRef extends CosObject {
	% true if headers of all subsections of the cross reference table comply to PDF/A standard
	property subsectionHeaderSpaceSeparated: Boolean;
	% true if the 'xref' keyword and the following cross reference subsection header are separated by a single EOL marker
	property xrefEOLMarkersComplyPDFA: Boolean;
}
package org.verapdf.model.external;

import org.verapdf.model.baselayer.Object;
import java.util.List;

% Parent type for all external objects embedded into the PDF document
type External extends Object {
	
}

% Embedded ICC profile
type ICCProfile extends External {
	% value of the N key in the ICC profile stream dictionary
	property N: Integer;
	% a four-byte string identifying the device class of the profile (monitor, printer, scanner, abstract color space)
	property deviceClass: String;
	% a four-byte string identifying the device class of the profile (GRAY, RGB, CMYK, LAB)
	property colorSpace: String;
	% version of the ICC profile
	property version: Decimal;
	% true if the profile satisfies the corresponding ICC Specification
	property isValid: Boolean;
}

% Embedded ICC profile used for ICCBased color spaces
type ICCInputProfile extends ICCProfile
{

}

% Embedded ICC profile used as a destination profile in the output intent dictionary
type ICCOutputProfile extends ICCProfile
{
	% subtype of the output profile
	property S: String;
}

% embedded font program
type FontProgram extends External {

}

% TrueType font program embedded into PDF document 
type TrueTypeFontProgram extends FontProgram {
	% true / false if the corresponding PDF Font is marked as symbolic / non-symbolic in its font dictionary
	property isSymbolic: Boolean;
	% number of cmap subtables in the font program
	property nrCmaps: Integer;
	% true if the font program contains the Microsoft Symbol (3,0 – Platform ID=3, Encoding ID=0) cmap subtable
	property cmap30Present: Boolean;
	% true if the font program contains the Microsoft Unicode (3,1 – Platform ID=3, Encoding ID=1) cmap subtable
	property cmap31Present: Boolean;
	% true if the font program contains the Macintosh Roman (1,0 – Platform ID=1, Encoding ID=0) cmap subtable
	property cmap10Present: Boolean;
}

% embedded CMap file
type CMapFile extends External {
	% the value of the WMode entry in the embedded CMap file
	property WMode: Integer;
	% the value of the WMode entry in the parent CMap dictionary
	property dictWMode: Integer;
	% maximal CID of code contained in this CMap file
	property maximalCID: Integer;
}

% JPEG2000 image
type JPEG2000 extends External {
	% the number of colour channels
	property nrColorChannels: Integer;
	% the number of colour space specifications
	property nrColorSpaceSpecs: Integer;
	% the number of colour space specifications with APPROX field set to 0x01
	property nrColorSpacesWithApproxField: Integer;
	% the METH entry in the 'colr' box specification with APPROX field equal to 0x01
	property colrMethod: Integer;
	% EnumCS (enumerated color space) field of in the 'colr' box specification with APPROX field equal to 0x01
	property colrEnumCS: Integer;
	% image bit depth
	property bitDepth: Integer;
	% true if the 'bpcc' box is present and, thus, the bit depth is not constant across all components
	property bpccBoxPresent: Boolean;
	% true, if Image XObject has /ColorSpace entry, which means that colr box in JPEG2000 should be ignored
	property hasColorSpace: Boolean;
}

% embedded file
type EmbeddedFile extends External {
	% MIME type of the embedded file (/Subtype entry in the embedded file dictionary)
	property Subtype: String;
	% true if this file is a valid PDF/A document (Part 1 or Part 2) on its own
	property isValidPDFA12: Boolean;
	% true if this file is a valid PDF/A document (Part 1, Part 2 or Part 4) on its own
	property isValidPDFA124: Boolean;
}

% PKCS#7 binary data object representing the PDF Signature
type PKCSDataObject extends External {
	% number of the SignerInfo structures
	property SignerInfoCount: Integer;
	% true if the object contains the X.509 signing certificate
	property signingCertificatePresent: Boolean;
}
package org.verapdf.model.operator;

import org.verapdf.model.baselayer.Object;
import org.verapdf.model.coslayer.CosInteger;
import org.verapdf.model.coslayer.CosNumber;
import org.verapdf.model.coslayer.CosString;
import org.verapdf.model.coslayer.CosArray;
import org.verapdf.model.coslayer.CosName;
import org.verapdf.model.coslayer.CosDict;
import org.verapdf.model.coslayer.CosRenderingIntent;
import org.verapdf.model.coslayer.CosLang;
import org.verapdf.model.coslayer.CosActualText;
import org.verapdf.model.coslayer.CosAlt;

import org.verapdf.model.pdlayer.PDColorSpace;
import org.verapdf.model.pdlayer.PDExtGState;
import org.verapdf.model.pdlayer.PDXObject;
import org.verapdf.model.pdlayer.PDInlineImage;
import org.verapdf.model.pdlayer.PDShading;
import org.verapdf.model.pdlayer.PDFont;

% base class for all operators in the content stream
type Operator extends Object {

}

% General graphics state operators
type OpGeneralGS extends Operator {

}

% we define arguments as links to the Cos objects rather than than simple properties 
% because they shall be checked for implementation limits

% set line width operator
type Op_w_line_width extends OpGeneralGS {
	% line width
	link lineWidth: CosNumber;
}

% set line cap operator
type Op_J_line_cap extends OpGeneralGS {
	% line cap
	link lineCap: CosInteger;
}

% set line join operator
type Op_j_line_join extends OpGeneralGS {
	% line join
	link lineJoin: CosInteger;
}

% miter limit operator
type Op_M_miter_limit extends OpGeneralGS {
	% miter limit
	link miterLimit: CosNumber;
}

% set dash pattern operator
type Op_d extends OpGeneralGS {
	% dash array
	link dashArray: CosArray;
	% dash phase
	link dashPhase: CosNumber;
}

% rendering intent operator
type Op_ri extends OpGeneralGS {
	% rendering intent
	link renderingIntent: CosRenderingIntent;
}

% flatness operator
type Op_i extends OpGeneralGS {
	% flatness
	link flatness: CosNumber;
}

% extended graphics state operator
type Op_gs extends OpGeneralGS {
	% ExtGState dictionary
	link extGState: PDExtGState;
}

% Special graphics state operators
type OpSpecialGS extends Operator {

}

% gsave operator
type Op_q_gsave extends OpSpecialGS {
	% the number of nested g/Q pair (subject to implementation limits)
	property nestingLevel: Integer;
}

% grestore operator
type Op_Q_grestore extends OpSpecialGS {

}

% current transformation matrix
type Op_cm extends OpSpecialGS {
	% the coefficients of the concatenation matrix
	link matrix: CosNumber+;
}

% Path construction operators
type OpPathConstruction extends Operator {

}

% moveto operator
type Op_m_moveto extends OpPathConstruction {
	% operator arguments
	link point: CosNumber+;
}

% lineto operator
type Op_l extends OpPathConstruction {
	% operator arguments
	link point: CosNumber+;
}

% curveto operator
type Op_c extends OpPathConstruction {
	% operator arguments
	link controlPoints: CosNumber+;
}

% special curveto operator
type Op_v extends OpPathConstruction {
	% operator arguments
	link controlPoints: CosNumber+;
}

% special curveto operator
type Op_y extends OpPathConstruction {
	% operator arguments
	link controlPoints: CosNumber+;
}

% close subpath operator
type Op_h extends OpPathConstruction {

}

% rect operator
type Op_re extends OpPathConstruction {
	% rectangle box
	link rectBox: CosNumber+;
}

% Path paint operators
type OpPathPaint extends Operator {

}

% path close and stroke operator
type Op_s_close_stroke extends OpPathPaint {
	% stroke color space
	link strokeCS: PDColorSpace;
}

% path stroke operator
type Op_S_stroke extends OpPathPaint {
	% stroke color space
	link strokeCS: PDColorSpace;
}

% path fill operator
type Op_f_fill extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
}

% another path fill operator
type Op_F_fill_obsolete extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
}

% path fill (even-odd rule) operator
type Op_FStar extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;	
}

% path fill and stroke operator
type Op_B_fill_stroke extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
	% stroke color space
	link strokeCS: PDColorSpace;		
}

% path fill (even-odd rule) and stroke operator
type Op_BStar_eofill_stroke extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
	% stroke color space
	link strokeCS: PDColorSpace;		
}

% path close, fill and stroke operator
type Op_b_closepath_fill_stroke extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
	% stroke color space
	link strokeCS: PDColorSpace;		
}

% path close, fill (even-odd rule) and stroke operator
type Op_bstar_closepath_eofill_stroke extends OpPathPaint {
	% fill color space
	link fillCS: PDColorSpace;
	% stroke color space
	link strokeCS: PDColorSpace;		
}

% path painting no-op
type Op_n extends OpPathPaint {

}

% Clip operators
type OpClip extends Operator {

}

% clip (non-zero rule)
type Op_W_clip extends OpClip {

}

% clip (even-odd rule)
type Op_WStar extends OpClip {

}


% Text object operators
type OpTextObject extends Operator {

}

type Op_ET extends OpTextObject {

}

type Op_BT extends OpTextObject {

}
%OpTextObject->Op_ET, Op_BT

% Text state operators
type OpTextState extends Operator {

}

type Op_Tz extends OpTextState {
	% the horizontal text scaling
	link scale: CosNumber;
}

type Op_Tr extends OpTextState {
	% rendering mode
	property renderingMode: Integer;
}

type Op_Tc extends OpTextState {
	% character spacing
	link charSpace: CosNumber;
}

type Op_Tf extends OpTextState {
	% font size
	link size: CosNumber;
	% the text font
	link fontName: CosName;
}

type Op_Tl extends OpTextState {
	% the text leading
	link leading: CosNumber;
}

type Op_Ts extends OpTextState {
	% text rise
	link rise: CosNumber;
}

type Op_Tw extends OpTextState {
	% word spacing
	link wordSpace: CosNumber;
}
%OpTextState->Op_Tc, Op_Tw, Op_Tz, Op_TL, Op_Tf, Op_Tr, Op_Ts

% Text position operators
type OpTextPosition extends Operator {

}

type Op_Td extends OpTextPosition {
	% horizontal offset
	link horizontalOffset: CosNumber;
	% vertical offset
	link verticalOffset: CosNumber;
}

type Op_TD_Big extends OpTextPosition {
	% horizontal offset
	link horizontalOffset: CosNumber;
	% vertical offset
	link verticalOffset: CosNumber;
}

type Op_Tm extends OpTextPosition {
	% elements of text matrix
	link controlPoints: CosNumber+;
}

type Op_T_Star extends OpTextPosition {

}
% OpTextPosition->Op_Td, Op_TD, Op_Tm, Op_T*

% Text show operators
type OpTextShow extends Operator {
	% Link to the current font
	link font: PDFont?;
	% Link to all glyphs used in the text
	link usedGlyphs: Glyph*;
	% fill color space, if the rendering mode specifies fill operation (0,2,4,6)
	link fillCS: PDColorSpace?;
	% stroke color space, if the rendering mode specifies stroke operation (1,2,5,6)
	link strokeCS: PDColorSpace?;
}

% Text show operator
type Op_Tj extends OpTextShow {
	% string to show (before font encoding mapping is applied)
	link showString: CosString;
}

% Text show operator with individual glyph positioning
type Op_TJ_Big extends OpTextShow {
	% array containing strings and glyphs width
	link specialStrings: CosArray;
}

% EOL and text show operator
type Op_Quote extends OpTextShow {
	% string to show (before font encoding mapping is applied)
	link showString: CosString;
}

% EOL and text show operator with char and word spacing
type Op_DoubleQuote extends OpTextShow {
	% string to show (before font encoding mapping is applied)
	link showString: CosString;
	% unscaled word spacing
	link wordSpacing: CosNumber;
	% unscaled character spacing
	link characterSpacing: CosNumber;
}


% Type3 font operators
type OpType3Font extends Operator {

}

type Op_d0 extends OpType3Font {
	% the horizontal displacement in the glyph coordinate system
	link horizontalDisplacement: CosNumber;
	% the vertical displacement in the glyph coordinate system
	link verticalDisplacement: CosNumber;
}

type Op_d1 extends OpType3Font {
	% width and bounding box information for the glyph
	link controlPoints: CosNumber+;
}
% OpType3Font->Op_d0, Op_d1

% Set color operators without colorspace, Op_SC, Op_sc
type OpSetColor extends Operator {
	% numeric arguments of the color operators
	link colorValues: CosNumber*;
}

type Op_SC_stroke extends OpSetColor {

}

type Op_sc_fill extends OpSetColor {

}

% Color operators
type OpColor extends OpSetColor {
	% color space set by this operator
	link colorSpace: PDColorSpace;
	% name of the tiling pattern in case of scn/SCN operators and the Pattern color space
	link patternName: CosName?;
}
% OpSetColor->Op_SC, Op_sc, OpColor

type Op_SCN_stroke extends OpColor {

}

type Op_scn_fill extends OpColor {

}

type Op_G_stroke extends OpColor {

}

type Op_g_fill extends OpColor {

}

type Op_RG_stroke extends OpColor {

}

type Op_rg_fill extends OpColor {

}

type Op_K_stroke extends OpColor {

}

type Op_k_fill extends OpColor {

}
% OpColor->Op_CS, Op_cs, Op_SCN, Op_scn, Op_G, Op_g, Op_RG, Op_rg, Op_K, Op_k

% Shading operators
type OpShading extends Operator {

}

% smooth shading operator
type Op_sh extends OpShading {
	% link to the corresponding Shading resource
	link shading: PDShading;
}

% Inline image operators
type OpInlineImage extends Operator {

}

% Begin inline image
type Op_BI extends OpInlineImage {

}

% End inline image dictionary
type Op_ID extends OpInlineImage {
	% link to dictionary containing image parameters
	link inlineImageDictionary : CosDict;
}

% End inline image data
type Op_EI extends OpInlineImage {
	% link to the inline image object
	link inlineImage: PDInlineImage;
}

% XObject operators
type OpXObject extends Operator {

}

% XObject Do operator
type Op_Do extends OpXObject {
	% link to the corresponding XObject resource
	link xObject: PDXObject;
}


% Marked content operators
type OpMarkedContent extends Operator {
    % actual text
    link actualText: CosActualText?;
    % alt
    link alt: CosAlt?;    
}

% define marked content point
type Op_MP extends OpMarkedContent {
	% tag name
	link tag: CosName;
}

% define marked content point with properties
type Op_DP extends OpMarkedContent {
	% tag name
	link tag: CosName;
	% properties dictionary
	link properties: CosDict;
}

% start marked content region
type Op_BMC extends OpMarkedContent {
	% tag name
	link tag: CosName;
}

% start marked content region with properties
type Op_BDC extends OpMarkedContent {
	% tag name
	link tag: CosName;
	% properties dictionary
	link properties: CosDict;
	% value of the Lang entry from properties dictionary
	link Lang: CosLang?;
}

% end marked content region
type Op_EMC extends OpMarkedContent {

}

% Compatibility operators
type OpCompatibility extends Operator {

}

% begin compatibility region
type Op_BX extends OpCompatibility {

}

% end compatibility region
type Op_EX extends OpCompatibility {

}

% any operator not defined in PDF Reference
type Op_Undefined extends OpCompatibility {
    % operator name
    property name: String;
}

% glyph used in text
type Glyph extends Object {
	% glyph name, or empty string if the glyph is not identified by the name (as in case of CID fonts)
	property name: String;
	% width of the glyph specified in the Font dictionary
	property widthFromDictionary: Decimal;
	% width of the glyph in the embedded font program
	property widthFromFontProgram: Decimal;
	% true if glyph is present in the font program
	property isGlyphPresent: Boolean;
	% unicode value of the glyph
	property toUnicode: String;
	% value of the rendering mode at the moment the glyph is shown
	property renderingMode: Integer;
	% true if toUnicode value contains codes from Unicode Private Use Area
	property unicodePUA: Boolean;
	% true if an ActualText entry is present for this glyph
	property actualTextPresent: Boolean;
	% true if an Alt entry is present for this glyph
	property altPresent: Boolean;
	% true if this glyph is a real content
	property isRealContent: Boolean;
}

% glyph in the composite font
type CIDGlyph extends Glyph {
	% CID value of the glyph as derived from the font CMap
	property CID: Integer;
}
package org.verapdf.model.pdlayer;

import org.verapdf.model.baselayer.Object;

import org.verapdf.model.coslayer.CosObject;
import org.verapdf.model.coslayer.CosDict;
import org.verapdf.model.coslayer.CosStream;
import org.verapdf.model.coslayer.CosReal;
import org.verapdf.model.coslayer.CosNumber;
import org.verapdf.model.coslayer.CosRenderingIntent;
import org.verapdf.model.coslayer.CosUnicodeName;
import org.verapdf.model.coslayer.CosIIFilter;
import org.verapdf.model.coslayer.CosBBox;
import org.verapdf.model.coslayer.CosBM;
import org.verapdf.model.coslayer.CosLang;
import org.verapdf.model.coslayer.CosTextString;
import org.verapdf.model.coslayer.CosActualText;
import org.verapdf.model.coslayer.CosAlt;

import org.verapdf.model.operator.Operator;

import org.verapdf.model.external.ICCOutputProfile;
import org.verapdf.model.external.ICCInputProfile;
import org.verapdf.model.external.FontProgram;
import org.verapdf.model.external.CMapFile;
import org.verapdf.model.external.JPEG2000;
import org.verapdf.model.external.PKCSDataObject;

import org.verapdf.model.xmplayer.XMPPackage;

import org.verapdf.model.selayer.SEContentItem;


% base class for all PD layer objects
type PDObject extends Object {
	% ampersand separated list of entries
	property entries: String;
	% indirect object number and generation number for the current object
	property objectKey: String;
}

% the class corresponding to the high level PDF document structure
type PDDocument extends PDObject {
	% the array of output intents of the document
	link outputIntents: OutputIntents?;
	% the collection of all document pages
	link pages: PDPage+;
	% document level metadata
	link metadata: PDMetadata?;
	% Interactive Form Dictionary (AcroForm entry in the Catalog)
	link AcroForm: PDAcroForm?;
	% additional actions dictionary defined for the document (AA entry in the Catalog)
	link AA: PDAdditionalActions?;
	% document open action (OpenAction entry in the Catalog)
	link OpenAction: PDAction?;
	% document open action destination (OpenAction entry in the Catalog)
	link OpenActionDestination: PDDestination?;
	% document outlines (Outlines entry in the Catalog)
	link Outlines: PDOutline*;
	% link to the optional content properties dictionary
	link OCProperties: PDOCProperties?;
	% the link to the document structure tree root dictionary
	link StructTreeRoot: PDStructTreeRoot?;
	% true if the document contains alternate presentations (/AlternatePresentations entry in the document names dictionary)
	property containsAlternatePresentations: Boolean;
	% value of the Lang entry from the document catalog
	link Lang: CosLang?;
	% link to the permissions object
	link Perms: PDPerms?;
	% true if the catalog dictionary contains the AA entry
	property containsAA: Boolean;
	% color space of output icc profile
	property outputColorSpace: String;
	% value of Version key of the document catalog dictionary
	property Version: String;
	% the most common page orientation in the document (Portrait, Landscape or Square)
	% if the most common orientation is Square, then second most common orientation if exists
	property mostCommonOrientation: String;
	% true if the document contains an XRefStream
	property containsXRefStream: Boolean;
}

% the object representing PDF page
type PDPage extends PDObject {
	% the array of output intents of the page
	link outputIntents: OutputIntents?;
	% additional actions dictionary defined for the page (AA entry)
	link AA: PDAdditionalActions?;
	% link to the transparency blending space
	link transparencyColorSpace: TransparencyColorSpace?;
	% page content stream
	link contentStream: PDContentStream;
	% all page annotations
	link annots: PDAnnot*;
	% link to the parent transparency blending space
	link parentTransparencyColorSpace: TransparencyColorSpace?;
	% group attributes dictionary
	link Group: PDGroup?;
	% page media box
	link MediaBox: CosBBox;
	% page crop box
	link CropBox: CosBBox?;
	% page bleed box
	link BleedBox: CosBBox?;
	% page trim box
	link TrimBox: CosBBox?;
	% page art box
	link ArtBox: CosBBox?;
	% true if the page contains presentation steps (/PresSteps in the page dictionary)
	property containsPresSteps: Boolean;
	% true if the page contains transparency
	property containsTransparency: Boolean;
	% contains group color space
	property containsGroupCS: Boolean;
	% true if the page dictionary contains the AA entry
	property containsAA: Boolean;
	% value of the /Tabs key in the page dictionary
	property Tabs: String;
	% page orientation (Portrait, Landscape or Square)
	property orientation: String;
	% color space of output icc profile
	property outputColorSpace: String;
	% page number
	property pageNumber: Integer;
	% link to resource dictionary
	link resources: PDResources?;
}

% transparency blending space
type TransparencyColorSpace extends Object {
    % color space type
    property colorSpaceType: String;
}

% the array of output intents
type OutputIntents extends Object {
	% the array of output intents
	link outputIntents: PDOutputIntent*;
	% true, if OutputIntents array contains more than one entry, all entries that contain a DestOutputProfile key
	% have as the value of that key the same indirect object, which shall be a valid ICC profile stream.
	property sameOutputProfileIndirect: Boolean;
	% comma separated list of output intents DestOutputProfile value
	property outputProfileIndirects: String;
}

% the object representing content stream together with the resource dictionary
type PDContentStream extends PDObject {
	% all operators in the content stream
	link operators: Operator*;
	% comma separated list of resource names, which referenced by content stream but missing in resource dictionary
	property undefinedResourceNames: String;
	% comma separated list of resource names, which are taken not from the resource dictionary explicitly associated
	% with the page content, but are inherited either from the pages tree (for pages) or from the parent page object
	% where the resource is used (for form XObjects, patterns, Type3 fonts, annotations).
	property inheritedResourceNames: String;
	% link to resource dictionary
	link resources: PDResources?;
}

% content stream with semantic objects (marked content sequences with /MCID entry)
% Corresponds to the content streams of pages, form XObjects and annotations
% Content streams of Tiling Patterns and Type3 glyphs are not treated as semantic content streams
type PDSemanticContentStream extends PDContentStream {
	% all content sequences (marked or unmarked) in the content stream
	link content: SEContentItem*;
}

% PDF resource object
type PDResource extends PDObject {
	% true if the resource is taken not from the resource dictionary explicitly associated with the page content, but is inherited either
	% from the parent page node (for pages) or from the parent page object where the resource is used (for patterns, Type3 fonts, annotations).
	property isInherited: Boolean;
}

% Color space object
type PDColorSpace extends PDResource {
	% number of components
	property nrComponents: Integer;
}

% Additional-actions dictionary
type PDAdditionalActions extends PDObject {
	% link to the additional actions
	link Actions: PDAction*;
	% type of parent object for additional actions
	property parentType: String;
}

% DeviceGray color space
type PDDeviceGray extends PDColorSpace {

}

% DeviceRGB color space
type PDDeviceRGB extends PDColorSpace {

}

% DeviceCMYK color space
type PDDeviceCMYK extends PDColorSpace {

}

% ICCBased color space
type PDICCBased extends PDColorSpace {
	% embedded ICC profile
	link iccProfile: ICCInputProfile;
	% string representation of the indirect link to the ICC profile
	property ICCProfileIndirect: String;
	% string representation of the indirect link to the current transparency ICC profile
	property currentTransparencyProfileIndirect: String;
	% string representation of the md5 of the ICC profile
	property ICCProfileMD5: String;
	% string representation of the md5 of the current transparency ICC profile
	property currentTransparencyICCProfileMD5: String;
}

% ICCBased CMYK colour space
type PDICCBasedCMYK extends PDICCBased {
	% the value of the OPM key (0 or 1)
	property OPM: Integer;
	% the value of overprint flag (true or false) effective for this colour space
	% (/OP if the colour space is used for stroke, and /op if it used for non-stroke operations)
	property overprintFlag: Boolean;
}

% Lab color space
type PDLab extends PDColorSpace {

}

% CalGray color space
type PDCalGray extends PDColorSpace {

}

% CalRGB color space
type PDCalRGB extends PDColorSpace {

}

% Separation color space
type PDSeparation extends PDColorSpace {
	% tint transform function
	link tintTransform: PDFunction;
	% alternate color space
	link alternate: PDColorSpace;
	% colorant name object
	link colorantName: CosUnicodeName;
	% colorant name value
	property name: String;
	% true if this is the first occurrence the colorant with this name, or if this is the repeating occurrence and
	% it has the same colorant name have the same titTransform and Alternate color space (compared as PDF objects)
	property areTintAndAlternateConsistent: Boolean;
}

% DeviceN color space
type PDDeviceN extends PDColorSpace {
	% tint transform function
	link tintTransform: PDFunction;
	% alternate color space
	link alternate: PDColorSpace;
	% colorant names
	link colorantNames: CosUnicodeName+;
	% link to all colorants defined in the Colorants entry of the attributes dictionary
	link Colorants: PDSeparation*;
	% link to the process color space defined in the attributes dictionary
	link processColor: PDColorSpace?;
	% true if all colorant names are present as keys in the Colorants dictionary of the DeviceN attributes dictionary
	property areColorantsPresent: Boolean;
}

% Indexed color space
type PDIndexed extends PDColorSpace {
	% base color space
	link base: PDColorSpace;
}

% generic Pattern type
type PDPattern extends PDColorSpace {

}

% tiling Pattern
type PDTilingPattern extends PDPattern {
	% content stream of the pattern
	link contentStream: PDContentStream;
}

% shading Pattern
type PDShadingPattern extends PDPattern {
	% shading object
	link shading: PDShading;
}

% PDF font dictionary
type PDFont extends PDResource {
	% font type (Type entry)
	property Type: String;
	% font subtype (Subtype entry)
	property Subtype: String;
	% font name defined by BaseFont entry in the font dictionary and FontName key in the font descriptor
	property fontName: String;
	% link to the name Object referenced by BaseFont key
	link BaseFont: CosUnicodeName;
	% true if the font flags in the font descriptor dictionary mark indicate that the font is symbolic (the entry /Flags has bit 3 set to 1 and bit 6 set to 0)
	property isSymbolic: Boolean;
	% rendering mode value
	property renderingMode: Integer;
	% embedded font program for Type 1, TrueType or CID Font
	link fontFile: FontProgram?;
	% value of the entry /Subtype in the embedded font file stream, or null, if the this entry is not present (or the font is not embedded)
	property fontFileSubtype: String;
	% value of Italic flag in Flags entry in the font descriptor
	property isItalic: Boolean;
}

% One of the simple font types (Type 1, TrueType, Type 3)
type PDSimpleFont extends PDFont {
	% true if the font is one of the 14 standard fonts defined in PDF 1.4 Reference
	property isStandard: Boolean;
	% FirstChar entry; null if LastChar entry is not present or has invalid type
	property FirstChar: Integer;
	% LastChar entry; null if LastChar entry is not present or has invalid type
	property LastChar: Integer;
	% The size of the Widths array; null if the Widths array is not present or has invalid type
	property Widths_size: Integer;
	% String representation of the font encoding:
	% - null if the /Encoding entry is not present in the font dictionary
	% - if /Encoding entry in the font dictionary if of Name type, then the value of this entry;
	% - if /Encoding entry is a dictionary, which does not contain /Differences array, then the value of /BaseEncoding entry in this dictionary (or null, if /BaseEncoding is also not present)
	property Encoding: String;
	% true if an Encoding dictionary contains a Differences entry
	property containsDifferences: Boolean;
}

% TrueType font dictionary
type PDTrueTypeFont extends PDSimpleFont {
	% true if all glyph names in the differences array of the Encoding dictionary are a part of the Adobe Glyph List
	% and the embedded font program contains the Microsoft Unicode (3,1 - Platform ID=3, Encoding ID=1) cmap subtable
	property differencesAreUnicodeCompliant: Boolean;
}

% Type1 font dictionary
type PDType1Font extends PDSimpleFont {
	% the value of the CharSet entry in the font descriptor dictionary
	property CharSet: String;
	% true if the CharSet is present and correctly lists all glyphs present in the embedded font program
	property charSetListsAllGlyphs: Boolean;
}

% Type3 font dictionary
type PDType3Font extends PDSimpleFont {
	% character strings
	link charStrings: PDContentStream*;
}

% CID Font dictionary
type PDCIDFont extends PDFont {
	% string representation of the CIDtoGIDMap entry ("Identity", or "Custom" in case of stream value)
	property CIDToGIDMap: String;
	% true if the CIDSet entry is present in the CID font descriptor dictionary
	property containsCIDSet: Boolean;
	% true if the CIDSet is present and correctly lists all glyphs present in the embedded font program
	property cidSetListsAllGlyphs: Boolean;
}

% Type0 font dictionary
type PDType0Font extends PDFont {
	% Ordering key from CIDSystemInfo
	property CIDFontOrdering: String;
	% Ordering key from CMap
	property CMapOrdering: String;
	% Registry key from CIDSystemInfo
	property CIDFontRegistry: String;
	% Registry key from CMap
	property CMapRegistry: String;
	% Supplement key from CIDSystemInfo
	property CIDFontSupplement: Integer;
	% Supplement key from CMap
	property CMapSupplement: Integer;
	% link to the descendant CIDFont
	link DescendantFonts: PDCIDFont;
	% font CMap (Encoding entry)
	link Encoding: PDCMap;
	% the name of the CMap
	property cmapName: String;
}

% CMap dictionary or one of the predefined CMap names
type PDCMap extends PDObject {
	% name of the CMap (or the value of one of the predefined CMap's)
	property CMapName: String;
	% link to the CMap referenced by the key /UseCMap
	link UseCMap: PDReferencedCMap?;
	% link to the embedded CMap file for a non-standard CMap
	link embeddedFile: CMapFile?;
}

% CMap that is referenced with UseCMap in other CMap
type PDReferencedCMap extends PDCMap {

}

% XObject resource
type PDXObject extends PDResource {
	% subtype of the XObject resource (Image, Form, PS)
	property Subtype: String;
	% true if the XObject dictionary contains OPI entry
	property containsOPI: Boolean;
	% true if the XObject dictionary contains SMask entry
	% according to the PDF Specification this key may be present only in the Image dictionary,
	% but ISO 19005-1:2005/Cor.2:2011 forbids SMask key for all XObject dictionaries
	property containsSMask: Boolean;
}

% Image XObject
type PDXImage extends PDXObject {
	% image color space
	link imageCS: PDColorSpace;
	% Interpolate key in the image dictionary or the value of the I key in the inline image dictionary
	property Interpolate: Boolean;
	% image alternates (Alternates key in Image dictionary)
	link Alternates: PDXImage*;
	% color rendering intent
	link Intent: CosRenderingIntent?;
	% in case the image stream uses JPX compression, the link to the corresponding JPEG2000 image
	link jpxStream: JPEG2000?;
	% link to the soft mask image (SMask key)
	link SMask: PDSMaskImage?;
	% true if the image dictionary contains Alternates key
	property containsAlternates: Boolean;
	% value of the BitsPerComponent key
	property BitsPerComponent: Integer;
}

% SMask image
% The link imageCS is redefined to return an empty list, as the DeviceGray color space used
% in the soft mask defines shape and is not subject to PDF/A validation
type PDSMaskImage extends PDXImage {

}

% Inline image object
type PDInlineImage extends PDXImage {
	% link to the inline image filters
	link F: CosIIFilter*;
}

% Form XObject
type PDXForm extends PDXObject {
	% value of the Subtype2 key
	property Subtype2: String;
	% true if the form XObject dictionary contains PS entry
	property containsPS: Boolean;
	% true if the form XObject dictionary contains Ref key
	property containsRef: Boolean;
	% link to the transparency blending space
	link transparencyColorSpace: TransparencyColorSpace?;
	% form content
	link contentStream: PDContentStream;
	% link to the parent transparency blending space
	link parentTransparencyColorSpace: TransparencyColorSpace?;
	% link to the group attributes dictionary
	link Group: PDGroup?;
	% false, if Form XObject contains MCIDs and is referenced more than once
	property isUniqueSemanticParent: Boolean;
}

% Resource dictionary
type PDResources extends PDObject {
    % link to font names, names of colourants in Separation and DeviceN colour spaces
    link resourcesNames: CosUnicodeName*;
}

% Group attributes dictionary
type PDGroup extends PDObject {
	% group subtype (S key)
	property S: String;
	% link to color space
	link colorSpace: PDColorSpace;
}

% ExtGState dictionary
type PDExtGState extends PDResource {
	% TR2 function
	property TR2NameValue: String;
	% true if the ExtGState dictionary contains TR key
	property containsTR: Boolean;
	% true if the ExtGState dictionary contains TR2 key
	property containsTR2: Boolean;
	% Halftone dictionary
	link HT: PDHalftone;
	% true if the ExtGState dictionary contains HTP key
	property containsHTP: Boolean;
	% true if the ExtGState dictionary contains HTO key
	property containsHTO: Boolean;
	% String representation of the SMask key ("None" or "Custom")
	property SMaskNameValue: String;
	% true if the ExtGState dictionary contains SMask key
	property containsSMask: Boolean;
	% true if the ExtGState dictionary contains BM key
	property containsBM: Boolean;
	% blend mode
	property BMNameValue: String;
	% link to blend mode
	link bm: CosBM?;
	% fill alpha
	property ca: Decimal;
	% stroke alpha
	property CA: Decimal;
	% the rendering intent
	link RI: CosRenderingIntent?;
	% custom TR functions
	link customFunctions: PDFunction*;
}

type PDHalftone extends PDObject {
	% Halftone type
	property HalftoneType: Integer;
	% Halftone name
	property HalftoneName: String;
	% colorant name from parent type 5 halftone
	property colorantName: String;
	% transfer function
	property TransferFunction: String;
	% custom TR functions
	link customFunction: PDFunction?;
	% nested halftones
	link halftones: PDHalftone*;
}

% Shading resource
type PDShading extends PDResource {
	% shading color space
	link colorSpace: PDColorSpace;
}

% annotation object
type PDAnnot extends PDObject {
	% annotation subtype
	property Subtype: String;
	% annotation opacity (CA key)
	property CA: Decimal;
	% annotation flags
	property F: Integer;
	% ampersand-separated list of all keys in the annotation's appearance dictionary (AP key)
	property AP: String;
	% the value of the /FT entry (Field type), in case this is the widget annotation representing the form field, or null, if this entry is not present
	property FT: String;
	% the type of the normal appearance entry (/N key) in the annotation appearance dictionary (/AP key) or null, if the normal appearance is not present
	property N_type: String;
	% appearance XForm streams of the annotation (N, D and R keys in the appearance dictionary)
	link appearance: PDXForm*;
	% true if the annotation dictionary contains the C entry
	property containsC: Boolean;
	% true if the annotation dictionary contains the IC entry
	property containsIC: Boolean;
	% link to the action associated with the annotation (A entry)
	link A: PDAction?;
	% link to the additional actions dictionary defined for the annotation (AA entry)
	link AA: PDAdditionalActions?;
	% the width of the annotation computed as an absolute value of the difference of value 1 and value 3 of the Rect entry
	property width: Decimal;
	% the height of the annotation computed as an absolute value of the difference of value 2 and value 4 of the Rect entry
	property height: Decimal;
	% true if the annotation dictionary contains the A entry
	property containsA: Boolean;
	% true if the annotation dictionary contains the AA entry
	property containsAA: Boolean;
	% struct parent element type
	property structParentType: String;
	% struct parent element standard type
	property structParentStandardType: String;
	% indirect object number and generation number of the parent struct element of the annotation
	property structParentObjectKey: String;
	% value of the Lang entry
	link Lang: CosLang?;
	% the value of the /Contents entry
	property Contents: String;
	% the Alt entry of parent structure element
	property Alt: String;
	% true, if annotation rectangle is outside page CropBox
	property isOutsideCropBox: Boolean;
	% true if this annotation is contained in an Artifact structure element (directly or indirectly)
	property isArtifact: Boolean;
	% link to blend mode
	link BM: CosBM?;
}

% markup annotation
type PDMarkupAnnot extends PDAnnot {
	% string representation of RC entry
	property RC: String;
	% true if the markup annotation contains the RC entry
	property containsRC: Boolean;
}

% 3d annotation
type PD3DAnnot extends PDAnnot {
	% link to 3D stream dictionary
	link stream3D: PD3DStream?;
}

% file attachment annotation
type PDFileAttachmentAnnot extends PDMarkupAnnot {
	% true if a file attachment annotation contains a FS entry
	property containsFS: Boolean;
	% value of an AFRelationship entry in the file specification dictionary 
	property AFRelationship: String;
}

% ink annotation
type PDInkAnnot extends PDMarkupAnnot {
}

% link annotation
type PDLinkAnnot extends PDAnnot {
	% link to the destination of link annotation 
	link Dest: PDDestination?;
	% object number and generation number of the Link annotation that targets a different location, 
	% but is contained in the same structure element as another Link annotation
	property differentTargetAnnotObjectKey: String;
	% object number and generation number of the Link annotation that targets the same location, 
	% but is contained contains in a different structure element as another Link annotation
	property sameTargetAnnotObjectKey: String;
}

% movie annotation
type PDMovieAnnot extends PDAnnot {
}

% popup annotation
type PDPopupAnnot extends PDAnnot {
}

% printer's mark annotation
type PDPrinterMarkAnnot extends PDAnnot {
}

% rich media annotation
type PDRichMediaAnnot extends PDAnnot {
}

% rubber stamp annotation
type PDRubberStampAnnot extends PDMarkupAnnot {
	% the value of the /Name entry
	property Name: String;
}

% screen annotation
type PDScreenAnnot extends PDAnnot {
}

% sound annotation
type PDSoundAnnot extends PDAnnot {
}

% trap network annotation
type PDTrapNetAnnot extends PDAnnot {
}

% watermark annotation
type PDWatermarkAnnot extends PDAnnot {
}


% widget annotation
type PDWidgetAnnot extends PDAnnot {
	% the value of the /TU entry (Field type), in case this is the widget annotation representing the form field,
	% or value of the parent's /TU entry, if this widget annotation is one of multiple children in a form field
	property TU: String;
	% true if the parent struct element contains an Lbl child
	property containsLbl: Boolean;
}

% destination object
type PDDestination extends PDObject {
	% true if this destination is structure
	property isStructDestination: Boolean;
}

% 3D stream dictionary
type PD3DStream extends PDObject {
	% value of Subtype entry
	property Subtype: String;
	% link to color space
	link colorSpace: PDColorSpace?;
}

% Interactive form dictionary
type PDAcroForm extends PDObject {
	% NeedAppearances flag
	property NeedAppearances: Boolean;
	% true if the form dictionary contains XFA key
	property containsXFA: Boolean;
	% root interactive form fields in the document
	link formFields: PDFormField*;
	% value of dynamicRender property in XFA
	property dynamicRender: String;
}

% Interactive form field
type PDFormField extends PDObject {
	% Field type
	property FT: String;
	% link to the additional actions dictionary defined in the interactive form field dictionary (AA entry)
	link AA: PDAdditionalActions?;
	% true if the form field dictionary contains the AA entry
	property containsAA: Boolean;
	% value of the Lang entry
	link Lang: CosLang?;
	% value of the TU entry
	property TU: String;
	% value of the Ff entry
	property Ff: Integer;
	% link to kids fields
	link Kids: PDFormField*;
}

% Form field of type text
type PDTextField extends PDFormField {
	% string representation of V entry
	property V: String;
	% string representation of RV entry
	property RV: String;
	% true if the text field contains the RV entry
	property containsRV: Boolean;	
}

% Form field of type signature
type PDSignatureField extends PDFormField {
	% Signature dictionary
	link V: PDSignature;
}

% Signature dictionary object
type PDSignature extends PDObject {
	% true if the ByteRange covers the entire document including the signature dictionary, but excluding the Signature itself
	property doesByteRangeCoverEntireDocument: Boolean;
	% link to the DER-encoded PKCS#7 data object representing PDF Signature
	link Contents: PKCSDataObject;
	% link to the signature reference dictionaries
	link Reference: PDSigRef*;
}

% the PDF action object
type PDAction extends PDObject {
	% action subtype
	property S: String;
	% next action (Next entry in the action dictionary)
	link Next: PDAction?;
}

% the Rendition action object
type PDRenditionAction extends PDAction {
	% Media clip dictionary
	link C: PDMediaClip?;
}

% the Encryption dictionary
type PDEncryption extends PDObject {
	% the value of the /P entry
	property P: Integer;
}

% the Media clip dictionary
type PDMediaClip extends PDObject {
	% the value of the CT entry
	property CT: String;
	% separated list of Alt entry
	property Alt: String;
	% true if Alt entry contains an even number of strings and strings in even places are not empty
	property hasCorrectAlt: Boolean;
}

% the Named action object
type PDNamedAction extends PDAction {
	% name of the action
	property N: String;
}

% the GoTo action object
type PDGoToAction extends PDAction {
	% true if this GoTo action contains structure destination
	property containsStructDestination: Boolean;
}

% the GoToRemote action object
type PDGoToRemoteAction extends PDAction {

}

% the XMP Metadata stream
type PDMetadata extends PDObject {
	% XMPPackage for PDMetadata in CosDict or XMPMainPackage for PDMetadata in PDDocument
	link XMPPackage: XMPPackage;
	% link to the CosStream contains this metadata
	link stream: CosStream;
	% value of the Filter key in the metadata stream dictionary
	property Filter: String;
	% true if this is catalog metadata
	property isCatalogMetadata: Boolean;
}

% the output intent dictionary
type PDOutputIntent extends PDObject {
	% string representation of the indirect link to the ICC output profile
	property destOutputProfileIndirect: String;
	% destination output profile
	link destProfile: ICCOutputProfile?;
	% true if the output intent dictionary contains DestOutputProfileRef key
	property containsDestOutputProfileRef: Boolean;
	% value of the /OutputConditionIdentifier entry in the output intent dictionary (or null, if this entry is not present)
	property OutputConditionIdentifier: String;
	% value of the /S entry (the output intent subtype) in the output intent dictionary (or null, if this entry is not present)
	property S: String;
	% string representation of the md5 of the ICC profile
	property ICCProfileMD5: String;
}

% Optional content properties dictionary
type PDOCProperties extends PDObject {
	% link to the default optional content dictionary
	link D: PDOCConfig;
	% link to alternate optional content configuration dictionaries
	link Configs: PDOCConfig*;
	% true if the OCProperties entry contains a Configs entry and
	% the Configs entry contains at least one optional content configuration dictionary
	property containsConfigs: Boolean;
}

type PDOCConfig extends PDObject {
	% name of the configuration (/Name entry in the optional content configuration dictionary)
	property Name: String;
	% true if the name of this config has already been found in the default config or in one of the optional configs
	property hasDuplicateName: Boolean;
	% string representation of the /AS key (or null, if this key does not exist in the config dictionary)
	% if this key is present, the property contain the space-concatenated values of the Event entries if all Usage Application dictionaries
	property AS: String;
	% comma separated list of all optional content groups in the document, which the Order array does not contain references to
    property OCGsNotContainedInOrder: String;
}


% the outline (or bookmark) dictionary
type PDOutline extends PDObject {
	% link to the associated action object (A entry in the outline dictionary)
	link A: PDAction?;
	% link to the title of outline
	link Title: CosTextString?;	
	% link to the destination of outline
	link Dest: PDDestination?;
}

% the structure tree node dictionary
type PDStructTreeNode extends PDObject {
	% immediate children of the structure tree node in the structure hierarchy
	link K: PDStructElem*;
	% ampersand separated list of child element types, role mapped to the standard types
	property kidsStandardTypes: String;
	% true if the structure tree node contains content items as its children
	property hasContentItems: Boolean;
}

% the structure tree root dictionary
type PDStructTreeRoot extends PDStructTreeNode {
	% all structure element names used in role map
	link roleMapNames: CosUnicodeName*;
	% namespace URI of standard type of the first kid
	property firstChildStandardTypeNamespaceURL: String;
}

% the structure element dictionary
type PDStructElem extends PDStructTreeNode {
	% parent element type, role mapped to the standard type
	property parentStandardType: String;
	% structure type
	link S: CosUnicodeName;
	% the namespace specified in the element dictionary (or the default namespace, if not explicitly specified) and 
	% the element tag separated by the colon
	property namespaceAndTag: String;
	% structure type
	property valueS: String;
	% standard structure type defined via role map
	property standardType: String;
	% value of the Lang entry
	link Lang: CosLang?;
	% value of parent Lang entry
	property parentLang: String;
	% remapped standard type value
	property remappedStandardType : String;
	% value of the /Alt entry
	property Alt: String;
	% value of the /ActualText entry
	property ActualText: String;
	% value of the /E entry
	property E: String;
	% true, if circular mapping exist
	property circularMappingExist: Boolean;
	% value of the ActualText entry
	link actualText: CosActualText?;
	% value of the Alt entry
	link alt: CosAlt?;	
	% the namespace and the tag within a given namespace that is remapped to another tag within the same namespace
	property roleMapToSameNamespaceTag: String;
	% true if the struct elem dictionary contains P entry
	property containsParent: Boolean;
}

% permissions dictionary referred by /Perms key from the document catalog
type PDPerms extends PDObject {
}

% signature references dictionary referred by /Reference key from the signature dictionary
type PDSigRef extends PDObject {
	% true if the document permissions dictionary contains DocMDP entry
	property permsContainDocMDP: Boolean;
}

% PDF function type
type PDFunction extends PDObject {
	% type of the function (0, 2, 3 or 4)
	property FunctionType: Integer;
}

% Type0 function
type PDType0Function extends PDFunction {
}

% Type2 function
type PDType2Function extends PDFunction {
}

% Type3 function
type PDType3Function extends PDFunction {
	link Functions: PDFunction*;
}

% Type4 function
type PDType4Function extends PDFunction {
	% link to all operators in type 4 function
	link operators: CosObject*;
}
package org.verapdf.model.salayer;

import org.verapdf.model.baselayer.Object;

import java.util.List;

type SAObject extends Object {
    % id of group in format id:<number>
    property structureID: String;
    % list of error codes
    property errorCodes: List<String>;
    % list of error arguments
    property errorArguments: List<List<String>>;
}

% the class corresponding to the high level PDF document structure
type SAPDFDocument extends Object {
    % the collection of all document pages
    link pages: SAPage+;
    % all document repeated characters
    link repeatedCharacters: SARepeatedCharacters*;
    % document's lists
    link lists: SAList*;
    % the link to the document structure tree root dictionary
    link StructTreeRoot: SAStructTreeRoot?;
}

% the structure tree root dictionary
type SAStructTreeRoot extends Object {
    % immediate children of the structure tree root in the structure hierarchy
    link children: SAStructElem*;
}

% the structure element dictionary
type SAStructElem extends SAObject {
    % immediate child of structure element
    link children: Object*;
    % structure type
    property valueS: String;
    % number ranging from 0 to 1 indicating the probability that the correct type is right defined
    property correctSemanticScore: Decimal;
    % supposed correct element type
    property correctType: String;
    % standard type of struct element
    property standardType: String;
    % true, if this is table struct element
    property isTableElem: Boolean;
    % true, if this is table child element
    property isTableChild: Boolean;
    % true, if this is list struct element
    property isListElem: Boolean;
    % true, if this is list child element
    property isListChild: Boolean;
    % false, if structure element contains other structure elements
    property isLeafElem: Boolean;
    % ampersand separated list of all standard types of parents element of this structure element in the structure hierarchy
    property parentsStandardTypes: String;
    % ampersand separated list of child element types, role mapped to the standard types
    property kidsStandardTypes: String;
    % parent element type, role mapped to the standard type
    property parentStandardType: String;
    % true, if this element has wrong type and all parents of this element have right types
    property hasLowestDepthError: Boolean;
    % number of the first page that contains the structure element
    property page: Integer;
    % number of the last page that contains the structure element
    property lastPage: Integer;
}

% a chunk such as text, image or other
type SAChunk extends Object {

}

% page
type SAPage extends Object {
    % page artifacts
    % link artifacts: SAChunk*;
    % all page annotations
    link annots: SAAnnotation*;
    % table borders in this page
    link tableBorders: SATableBorder*;
}

% annotation object
type SAAnnotation extends Object {
    % text located on page in Rect
    property textValue: String;
    % annotation flags
    property F: Integer;
    % the value of the /Contents entry
    property Contents: String;
    % the Alt entry of parent structure element
    property Alt: String;
    % true, if annotation rectangle is outside page CropBox
    property isOutsideCropBox: Boolean;
}

% repeated characters object
type SARepeatedCharacters extends Object {
    % true, if repeated characters are not spaces
    property isNonSpace: Boolean;
    % number of repeated characters
    property numberOfRepeatedCharacters: Integer;
}

% link annotation
type SALinkAnnotation extends SAAnnotation {
    % true, if text value is link
    property textValueIsLink: Boolean;
    % true, if /Contents entry is link
    property contentsIsLink: Boolean;
    % true, if /Alt entry is link
    property altIsLink: Boolean;
}

% text chunk
type SATextChunk extends SAChunk {
    % text size
    property textSize: Decimal;
    % contrast ratio
    property contrastRatio: Decimal;
    % text weight
    property textWeight: Decimal;
    % true, if this text chunk has style different from common style
    property hasSpecialStyle: Boolean;
    % true, if this text chunk has background different from common background
    property hasSpecialBackground: Boolean;
    % true, if this text chunk is underlined
    property isUnderlined: Boolean;
    % ampersand separated list of all parent elements standard types of this text chunk in the structure hierarchy
    property parentsStandardTypes: String;
    % true, if this text chunk consists of white spaces
    property isWhiteSpaceChunk: Boolean;
}

% image chunk
type SAImageChunk extends SAChunk {
}

% line art chunk
type SALineArtChunk extends SAChunk {
}

% table border
type SATableBorder extends Object {
    % rows of this table
    link rows: SATableBorderRow*;
}

% table border row
type SATableBorderRow extends Object {
    % cells in this row
    link cells: SATableBorderCell*;
}

% table border cell
type SATableBorderCell extends SAObject {
    % colspan of this cell
    property colSpan: Integer;
    % rowspan of this cell
    property rowSpan: Integer;
}

% list
type SAList extends Object {
    % list items of this list
    link items: SAListItem*;
}

% list item
type SAListItem extends SAObject {
}

% <Document> structure element
type SADocument extends SAStructElem {
}

% <Part> structure element
type SAPart extends SAStructElem {
}

% <Div> structure element
type SADiv extends SAStructElem {
}

% <Caption> structure element
type SACaption extends SAStructElem {
}

% <H> structure element
type SAH extends SAStructElem {
}

% <P> structure element
type SAP extends SAStructElem {
}

% <L> structure element
type SAL extends SAStructElem {
}

% <LI> structure element
type SALI extends SAStructElem {
}

% <Lbl> structure element
type SALbl extends SAStructElem {
}

% <LBody> structure element
type SALBody extends SAStructElem {
}

% <Table> structure element
type SATable extends SAStructElem {
}

% <TR> structure element
type SATR extends SAStructElem {
}

% <TH> or <TD> structure element
type SATableCell extends SAStructElem {

}

% <TH> structure element
type SATH extends SATableCell {
}

% <TD> structure element
type SATD extends SATableCell {
}

% <Span> structure element
type SASpan extends SAStructElem {
}

% <Link> structure element
type SALink extends SAStructElem {
}

% <Art> structure element (only PDF 1.7)
type SAArt extends SAStructElem {
}

% <Sect> structure element
type SASect extends SAStructElem {
}

% <BlockQuote> structure element (only PDF 1.7)
type SABlockQuote extends SAStructElem {
}

% <TOC> structure element (only PDF 1.7)
type SATOC extends SAStructElem {
}

% <TOCI> structure element (only PDF 1.7)
type SATOCI extends SAStructElem {
}

% <Index> structure element (only PDF 1.7)
type SAIndex extends SAStructElem {
}

% <NonStruct> structure element
type SANonStruct extends SAStructElem {
}

% <Private> structure element
type SAPrivate extends SAStructElem {
}

% <Quote> structure element
type SAQuote extends SAStructElem {
}

% <Note> structure element (only PDF 1.7)
type SANote extends SAStructElem {
}

% <Reference> structure element
type SAReference extends SAStructElem {
}

% <BibEntry> structure element (only PDF 1.7)
type SABibEntry extends SAStructElem {
}

% <Code> structure element (only PDF 1.7)
type SACode extends SAStructElem {
}

% <Hn> structure element (or one of <H1> to <H6> in PDF 1.7)
type SAHn extends SAStructElem {
}

% <Figure> structure element
type SAFigure extends SAStructElem {
    % true, if figure has bounding box
    property hasBBox: Boolean;
}

% <Formula> structure element
type SAFormula extends SAStructElem {
}

% <Form> structure element
type SAForm extends SAStructElem {
}

% <THead> structure element
type SATHead extends SAStructElem {
}

% <TBody> structure element
type SATBody extends SAStructElem {
}

% <TFoot> structure element
type SATFoot extends SAStructElem {
}

% <Annot> structure element
type SAAnnot extends SAStructElem {
}

% <Ruby> structure element
type SARuby extends SAStructElem {
}

% <Warichu> structure element
type SAWarichu extends SAStructElem {
}

% <RB> structure element
type SARB extends SAStructElem {
}

% <RT> structure element
type SART extends SAStructElem {
}

% <RP> structure element
type SARP extends SAStructElem {
}

% <WT> structure element
type SAWT extends SAStructElem {
}

% <WP> structure element
type SAWP extends SAStructElem {
}

% <DocumentFragment> structure element (only PDF 2.0)
type SADocumentFragment extends SAStructElem {
}

% <Aside> structure element (only PDF 2.0)
type SAAside extends SAStructElem {
}

% <Title> structure element (only PDF 2.0)
type SATitle extends SAStructElem {
}

% <FENote> structure element (only PDF 2.0)
type SAFENote extends SAStructElem {
}

% <Sub> structure element (only PDF 2.0)
type SASub extends SAStructElem {
}

% <Em> structure element (only PDF 2.0)
type SAEm extends SAStructElem {
}

% <Strong> structure element (only PDF 2.0)
type SAStrong extends SAStructElem {
}

% <Artifact> structure element (only PDF 2.0)
type SAArtifact extends SAStructElem {
}

% the structure element with no mapping to the standard PDF 1.7 or PDF 2.0 tag
type SANonStandard extends SAStructElem {
}
package org.verapdf.model.selayer;

import org.verapdf.model.baselayer.Object;

import org.verapdf.model.pdlayer.PDStructElem;

import org.verapdf.model.coslayer.CosLang;

import java.util.List;

% the structure element with no mapping to the standard PDF 1.7 or PDF 2.0 tag
type SENonStandard extends PDStructElem {
    % true, if the struct elem has non-standard type, which is not mapped to a standard type
    property isNotMappedToStandardType: Boolean;
}

% <Document> structure element
type SEDocument extends PDStructElem {
}

% <Part> structure element
type SEPart extends PDStructElem {
}

% <Div> structure element
type SEDiv extends PDStructElem {
}

% <Caption> structure element
type SECaption extends PDStructElem {
}

% <H> structure element
type SEH extends PDStructElem {
}

% <P> structure element
type SEP extends PDStructElem {
}

% <L> structure element
type SEL extends PDStructElem {
	% value of the ListNumbering attribute
	property ListNumbering: String;
	% true if this list contains at least one Lbl descendant node
	property containsLabels: Boolean;
}

% <LI> structure element
type SELI extends PDStructElem {
}

% <Lbl> structure element
type SELbl extends PDStructElem {
}

% <LBody> structure element
type SELBody extends PDStructElem {
}

% <Table> structure element
type SETable extends PDStructElem {
	% false, if the table's structure is not determinable via Headers and IDs,
	% and structure elements of type TH don't have a Scope attribute
	property useHeadersAndIdOrScope: Boolean;
	% column span of the table
	property columnSpan: Integer;
	% row span of the table
	property rowSpan: Integer;
	% number of row with wrong column span
	property numberOfRowWithWrongColumnSpan: Integer;
	% number of column with wrong row span
	property numberOfColumnWithWrongRowSpan: Integer;
	% column span of row, which number contains property numberOfRowWithWrongColumnSpan
	property wrongColumnSpan: Integer;
}

% <TR> structure element
type SETR extends PDStructElem {
}

% <TH> or <TD> structure element
type SETableCell extends PDStructElem {
	% value of /ColSpan entry
	property ColSpan: Integer;
	% value of /RowSpan entry
	property RowSpan: Integer;
	% true, if this cell contains intersection(s) with other cell(s)
	property hasIntersection: Boolean;
}

% <TH> structure element
type SETH extends SETableCell {
}

% <TD> structure element
type SETD extends SETableCell {
	% true, if this cell has connected header(s)
	property hasConnectedHeader: Boolean;
	% true, if some elements of Headers array of this cell don't present as id in any TH
	property unknownHeaders: String;
}

% <Span> structure element
type SESpan extends PDStructElem {
}

% <Link> structure element
type SELink extends PDStructElem {
}

% <Art> structure element (only PDF 1.7)
type SEArt extends PDStructElem {
}

% <Sect> structure element
type SESect extends PDStructElem {
}

% <BlockQuote> structure element (only PDF 1.7)
type SEBlockQuote extends PDStructElem {
}

% <TOC> structure element (only PDF 1.7)
type SETOC extends PDStructElem {
}

% <TOCI> structure element (only PDF 1.7)
type SETOCI extends PDStructElem {
	% true if this TOCI element or one of its descendant nodes contains Ref entry
	property containsRef: Boolean;
}

% <Index> structure element (only PDF 1.7)
type SEIndex extends PDStructElem {
}

% <NonStruct> structure element
type SENonStruct extends PDStructElem {
}

% <Private> structure element
type SEPrivate extends PDStructElem {
}

% <Quote> structure element
type SEQuote extends PDStructElem {
}

% <Note> structure element (only PDF 1.7)
type SENote extends PDStructElem {
	% value of the ID entry
	property noteID: String;
	% true if this id has already been found
	property hasDuplicateNoteID: Boolean;
}

% <Reference> structure element
type SEReference extends PDStructElem {
}

% <BibEntry> structure element (only PDF 1.7)
type SEBibEntry extends PDStructElem {
}

% <Code> structure element (only PDF 1.7)
type SECode extends PDStructElem {
}

% <Hn> structure element (or one of <H1> to <H6> in PDF 1.7)
type SEHn extends PDStructElem {
	% false if first heading tag is not H1 or numbered heading levels are skipped
	property hasCorrectNestingLevel : Boolean;
	% nesting level of this heading
    property nestingLevel : Integer;
}

% <Figure> structure element
type SEFigure extends PDStructElem {
}

% <Formula> structure element
type SEFormula extends PDStructElem {
    % true if this formula contains at least one direct child from MathML namespace
    property isMathFormula: Boolean;
}

% any structure element in MathML namespace
type SEMathMLStructElem extends PDStructElem {
}

% a content item such as text, image, lineart, shading or a form
type SEContentItem extends Object {
	% list of tags, associated with parents marked content sequences (first operand of the BMC/BDC operators)
	property parentsTags: List<String>;
	% type of the parent structure element for parent marked content sequence
	property parentStructureTag: String;
	% true, if parent struct element is a part of the structure tree
	property isTaggedContent: Boolean;
	% object key of parent struct element
	property parentStructureElementObjectKey: String;
	% standard type of the parent structure element for parent marked content sequence
	% (if it is a part of the structure tree), null, if it is not a part of the structure tree
	property parentStandardTag: String;
	% value of the ActualText entry
	property ActualText: String;
	% value of the Alt entry
	property Alt: String;
	% true if this content item is contained in appearance stream of the widget annotation associated with a interactive field of type 'Signature'
	property isSignature: Boolean;
	% true if this content item is contained in an Artifact structure element (directly or indirectly)
	property isArtifact: Boolean;
}

% a sequence of content items
type SEGroupedContent extends SEContentItem {
	% all content items within this content sequence
	link contentItem: SEContentItem*;
}

% a content item such as text, image, lineart, shading or a form
type SESimpleContentItem extends SEContentItem {
	% type of this content item ('text', 'image', 'lineart' or 'shading')
	property itemType: String;
	% true if this content item is contained in a Formula structure element (directly or indirectly)
	property isFormula: Boolean;
	% true if this content item is contained in a Figure structure element (directly or indirectly)
	property isFigure: Boolean;
}

% content sequence marked via BMC/BDC and EMC operators
type SEMarkedContent extends SEGroupedContent {
	% tag associated with this marked content sequence (first operand of the BMC/BDC operators)
	property tag: String;
	% type of the parent structure element for this marked content sequence (if it is a part of the structure tree)
	% value of the E entry
	property E: String;
	% value of the Lang entry
	property Lang: String;
	% the value of Lang determined using inheritance rules from ISO 32000-1
	property inheritedLang: String;
}

% a sequence of content items not included into any marked content sequence
type SEUnmarkedContent extends SEGroupedContent {
}

% text content item (originated from operators Tj and TJ)
type SETextItem extends SESimpleContentItem {
	% font name of text item
	property fontName: String;
	% scale factor of text item
	property scaleFactor: Decimal;
	% value of Lang
	property Lang: String;
}

% lineart content item (originated from path painting operators)
type SELineArtItem extends SESimpleContentItem {
}

% shading content item (originated from operator sh)
type SEShadingItem extends SESimpleContentItem {
}

% image content item (inline or image XObject)
type SEImageItem extends SESimpleContentItem {
}

% inline image content item
type SEInlineImageItem extends SEImageItem {
}

% image XObject content item
type SEImageXObjectItem extends SEImageItem {
}

% <Form> structure element
type SEForm extends PDStructElem {
    % value of the Role attribute, or null if this attribute is not present
    property roleAttribute: String;
    % true, if form element has only one child identifying the widget annotation
    property hasOneInteractiveChild: Boolean;
    % number of widget annotations contained in a given Form structure element
    property widgetAnnotsCount: Integer;
}

% <THead> structure element
type SETHead extends PDStructElem {
}

% <TBody> structure element
type SETBody extends PDStructElem {
}

% <TFoot> structure element
type SETFoot extends PDStructElem {
}

% <Annot> structure element
type SEAnnot extends PDStructElem {
}

% <Ruby> structure element
type SERuby extends PDStructElem {
}

% <Warichu> structure element
type SEWarichu extends PDStructElem {
}

% <RB> structure element
type SERB extends PDStructElem {
}

% <RT> structure element
type SERT extends PDStructElem {
}

% <RP> structure element
type SERP extends PDStructElem {
}

% <WT> structure element
type SEWT extends PDStructElem {
}

% <WP> structure element
type SEWP extends PDStructElem {
}

% <DocumentFragment> structure element (only PDF 2.0)
type SEDocumentFragment extends PDStructElem {
}

% <Aside> structure element (only PDF 2.0)
type SEAside extends PDStructElem {
}

% <Title> structure element (only PDF 2.0)
type SETitle extends PDStructElem {
}

% <FENote> structure element (only PDF 2.0)
type SEFENote extends PDStructElem {
    % value of the NoteType attribute
    property NoteType : String;
    % comma separated list of object numbers that are missing in the Ref entry of a given FENote
    property orphanRefs : String;
    % comma separated list of object numbers that are present in the Ref entry of a given FENote, while these structure elements do not reference this FENote 
    property ghostRefs : String;
}

% <Sub> structure element (only PDF 2.0)
type SESub extends PDStructElem {
}

% <Em> structure element (only PDF 2.0)
type SEEm extends PDStructElem {
}

% <Strong> structure element (only PDF 2.0)
type SEStrong extends PDStructElem {
}

% <Artifact> structure element (only PDF 2.0)
type SEArtifact extends PDStructElem {
}
package org.verapdf.model.xmplayer;

import org.verapdf.model.baselayer.Object;
import java.util.Set;

% Parent type for all XMP objects
type XMPObject extends Object {
}

% XMP package
type XMPPackage extends XMPObject {

    % collection of all XMP properties
    link Properties: XMPProperty*;

    % collection of all containers of the extension schemas defined in XMP package
    link ExtensionSchemasContainers: ExtensionSchemasContainer*;

    % true if package serialization is valid:
    % - package starts with one of the expected byte arrays representing package beginning in a supported encoding
    % - package represents a well-formed XML that is serialized using the encoding of the matched byte array
    property isSerializationValid: Boolean;

    % the actual encoding used for XMP package serialization
    % it is different from the encoding property, which is declared encoding (deprecated)
    property actualEncoding: String;

    % value of ‘bytes’ attribute of XMP package header (null if the attribute is missing)
    property bytes: String;

    % value of ‘encoding’ attribute of XMP package header (null if the attribute is missing)
    property encoding: String;
}

% Main XMP package
% This object is not used for validating correspondence between document info
% dictionary entries and XMP properties - this is validated in CosDocument object
type MainXMPPackage extends XMPPackage {

    % object representing PDF/A identification (set of properties from PDF/A Identification schema) of the document
    link Identification: PDFAIdentification;

    % object representing PDF/UA identification (set of properties from PDF/UA Identification schema) of the document
    link UAIdentification: PDFUAIdentification;

    % value of dc:title
    property dc_title: String;
    
    % set of declarations
    property declarations: Set<String>;
}

% XMP property
type XMPProperty extends XMPObject {

    % true if this property is predefined (available in predefined schema) for PDF/A-1
    property isPredefinedInXMP2004: Boolean;

    % true if this property is predefined (available in predefined schema) for PDF/A-2 or for PDF/A-3
    property isPredefinedInXMP2005: Boolean;

    % true if this property defined in extension schema in current XMP package
    property isDefinedInCurrentPackage: Boolean;

    % true if this property defined in extension schema in main XMP package
    property isDefinedInMainPackage: Boolean;

    % true if the property value type corresponds to the type defined by XMP specification or extension schema
    property isValueTypeCorrect: Boolean;

    % type defined by XMP specification or extension schema
    property predefinedType: String;
}

% XMPMM History property
type XMPMMHistoryProperty extends XMPProperty {
    % Resource Events from xmpMM History property
    link ResourceEvents: XMPMMHistoryResourceEvent+;
}

% Language Alternative property
type XMPLangAlt extends XMPProperty {
     % true if the Language alternative array has only a default value with an undefined language (x-default)
     property xDefault: Boolean;
}

% Resource Event structures of xmpMM History property
type XMPMMHistoryResourceEvent extends XMPObject {
    % action value from Resource Event structure
    property action: String;

    % parameters value from Resource Event structure
    property parameters: String;

    % when value from Resource Event structure
    property when: String;
}

type PDFAIdentification extends XMPObject {

    % value of ‘part’ property from PDF/A Identification schema
    property part: Integer;

    % value of ‘conformance’ property from PDF/A Identification schema
    property conformance: String;

    % string value of ‘rev’ property from PDF/A Identification schema
    property rev: String;

    % namespace prefix for the ‘part’ property from PDF/A Identification schema
    property partPrefix: String;

    % namespace prefix for the ‘conformance’ property from PDF/A Identification schema
    property conformancePrefix: String;

    % namespace prefix for the ‘amd’ property from PDF/A Identification schema
    property amdPrefix: String;

    % namespace prefix for the ‘corr’ property from PDF/A Identification schema
    property corrPrefix: String;

    % namespace prefix for the ‘rev’ property from PDF/A Identification schema
    property revPrefix: String;

}

type PDFUAIdentification extends XMPObject {

    % value of ‘part’ property from PDF/UA Identification schema
    property part: Integer;

    % string value of ‘rev’ property from PDF/UA Identification schema
    property rev: String;

    % namespace prefix for the ‘part’ property from PDF/UA Identification schema
    property partPrefix: String;

    % namespace prefix for the ‘amd’ property from PDF/UA Identification schema
    property amdPrefix: String;
    
    % namespace prefix for the ‘corr’ property from PDF/UA Identification schema
    property corrPrefix: String;

    % namespace prefix for the ‘rev’ property from PDF/UA Identification schema
    property revPrefix: String;

}

% Parent type for all extension schema definition objects
type ExtensionSchemaObject extends XMPObject {

    % true if the object contains undefined fields
    property containsUndefinedFields: Boolean;

    % comma separated list of undefined fields
    property undefinedFields: String;

}

% Container of the extension schemas defined in XMP package
type ExtensionSchemasContainer extends XMPObject {

    % collection of the extension schema definitions
    link ExtensionSchemaDefinitions: ExtensionSchemaDefinition*;

    % namespace prefix for the container
    property prefix: String;

    % true if extension schema container is of type Bag
    property isValidBag: Boolean;
}

% Extension schema definition from the XMP package
type ExtensionSchemaDefinition extends ExtensionSchemaObject {

    % collection of XMP properties defined in the extension schema
    link ExtensionSchemaProperties: ExtensionSchemaProperty*;

    % collection of XMP value types defined in the extension schema
    link ExtensionSchemaValueTypes: ExtensionSchemaValueType*;

    % true if extension schema namespace URI (’pdfaSchema:namespaceURI’ property) is of type URI
    property isNamespaceURIValidURI: Boolean;

    % true if extension schema preferred prefix (’pdfaSchema:prefix’ property) is of type Text
    property isPrefixValidText: Boolean;

    % true if extension schema properties list (’pdfaSchema:property’ property) is of type Seq
    property isPropertyValidSeq: Boolean;

    % true if extension schema description (’pdfaSchema:schema’ property) is of type Text
    property isSchemaValidText: Boolean;

    % true if extension schema value types list (’pdfaSchema:valueType’ property) is of type Seq
    property isValueTypeValidSeq: Boolean;

    % namespace prefix for the extension schema namespace URI property
    property namespaceURIPrefix: String;

    % namespace prefix for the extension schema prefix property
    property prefixPrefix: String;

    % namespace prefix for the extension schema properties list property
    property propertyPrefix: String;

    % namespace prefix for the extension schema schema description property
    property schemaPrefix: String;

    % namespace prefix for the extension schema value type list property
    property valueTypePrefix: String;
}

% Extension schema property definition
type ExtensionSchemaProperty extends ExtensionSchemaObject {

    % category field value
    property category: String;

    % true if property category (’pdfaProperty:category’ property) is of type Text
    property isCategoryValidText: Boolean;

    % true if property description (’pdfaProperty:description’ property) is of type Text
    property isDescriptionValidText: Boolean;

    % true if property name (’pdfaProperty:name’ property) is of type Text
    property isNameValidText: Boolean;

    % true if property value type (’pdfaProperty:valueType’ property) is of type Text
    property isValueTypeValidText: Boolean;

    % true if property value type (’pdfaProperty:valueType’ property) is defined
    property isValueTypeDefined: Boolean;

    % namespace prefix for the category property
    property categoryPrefix: String;

    % namespace prefix for the description property
    property descriptionPrefix: String;

    % namespace prefix for the name property
    property namePrefix: String;

    % namespace prefix for the value type property
    property valueTypePrefix: String;
}

% Extension schema value type definition
type ExtensionSchemaValueType extends ExtensionSchemaObject {

    % collection of fields used in the type definition
    link ExtensionSchemaFields: ExtensionSchemaField*;

    % true if type description (’pdfaType:description’ property) is of type Text
    property isDescriptionValidText: Boolean;

    % true if type fields list (’pdfaType:field’ property) is of type Seq
    property isFieldValidSeq: Boolean;

    % true if type namespace URI (’pdfaType:namespaceURI’ property) is of type URI
    property isNamespaceURIValidURI: Boolean;

    % true if type preferred prefix (’pdfaType:prefix’ property) is of type Text
    property isPrefixValidText: Boolean;

    % true if type name (’pdfaType:type’ property) is of type Text
    property isTypeValidText: Boolean;

    % namespace prefix for the description type
    property descriptionPrefix: String;

    % namespace prefix for the fields list type
    property fieldPrefix: String;

    % namespace prefix for the namespace URI type
    property namespaceURIPrefix: String;

    % namespace prefix for the prefix type
    property prefixPrefix: String;

    % namespace prefix for the type type
    property typePrefix: String;
}

% Extension schema field definition
type ExtensionSchemaField extends ExtensionSchemaObject {

    % true if field description (’pdfaField:description’ property) is of type Text
    property isDescriptionValidText: Boolean;

    % true if field name (’pdfaField:name’ property) is of type Text
    property isNameValidText: Boolean;

    % true if field value type (’pdfaField:valueType’ property) is of type Text
    property isValueTypeValidText: Boolean;

    % true if field value type (’pdfaField:valueType’ property) is defined
    property isValueTypeDefined: Boolean;

    % namespace prefix for the description field
    property descriptionPrefix: String;

    % namespace prefix for the name field
    property namePrefix: String;

    % namespace prefix for the value type field
    property valueTypePrefix: String;
}
